Heroku 403 Forbidden - Laravel 5

Related searches

I have a Laravel 5.8 site

https://boss-security-2.herokuapp.com/

I deployed to Heorku to test with this script that I created

appName='boss-security-2'
echo 'appName =' $appName


# heroku apps
# heroku apps:destroy appName --confirm appName
# ----------------------

echo web: vendor/bin/heroku-php-apache2 public/ > Procfile
git init
git status
git add -A
git commit -m "Initial commit"

heroku create $appName
heroku git:remote -a $appName
heroku buildpacks:set heroku/php
heroku config:set APP_KEY=9O7AegDFJhVC16jLfNNepT7TEQ7FyFZc

git push heroku master

heroku apps:info
heroku open
echo "done"
#

I kept getting

Forbidden

>

You don't have permission to access this resource


Anything wrong in my script ?


Composer.json
{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "guzzlehttp/guzzle": "~6.0",
        "laravel/framework": "5.8.*",
        "laravel/tinker": "^1.0",
        "laravelcollective/html": "~5.0",
        "nesbot/carbon": "^2.19",
        "pusher/pusher-php-server": "^3.4"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-install-cmd": [
            "php artisan clear-compiled",
            "chmod -R 777 public/"
        ]
    },

}

Update 1

I checked the log, I saw this

Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive


Update 2

I have no idea why my composer.json in my dyno doesn't seem to have my latest code. I SSHed in and check.

heroku ps:exec

Is this has something to do with my composer.lock ?

try this to solve your problem. add this in your composer.json

 "post-install-cmd": [
     "php artisan clear-compiled",
     "chmod -R 777 public/"
 ]

Problem deploying Laravel 4.2 App on Heroku- Error 403 Forbidden, Problem deploying Laravel 4.2 App on Heroku- Error 403 Forbidden. Posted 5 years ago by Mwaa. Am creating an app on heroku however i have been unable � Laravel 5 with Heroku: “/” route returns 403 Forbidden but indexes are not allowed, hence the 403. Laravel on Heroku: it's trying to go to /app/ (403

Probably You Pushed The Directories with wrong Permissions in your remote git repository

  1. Goto Your local code
  2. Update the Permissions
  3. and push back the code
  4. take a pull from the Heroku app

Laravel 5.4 on Heroku. Forbidden You don't have , Heroku Laravel 403 Forbidden, Cant display my webpage with Laravel 5.8.16 I walk you through the configuration and deployment of a Laravel 5 application. My Laravel 5.5 app not working on remote server na Make Laravel request from array with objects; Get values from blade to Model function Laravel; Laravel Eloquent Join Using Another table; Incorrect datetime value 1292 laravel 5.7 just fro Class controller not found; how to use php tidy in laravel? Use groupBy and foreach

I've tried http://boss-security-2.herokuapp.com/artisan and it shows the artisan sourcecode. (It should not)

I think you misconfigured the root folder.

Update

You've said that your composer.json is not updated. Have you tried to commit and push all your changes?

git add -A && git commit -m 'update' && git push heroku master

Then try to SSH and list the contents

heroku ps:exec
pwd && ls -la && cat Procfile

Heroku 403 Forbidden - Laravel 5, Heroku 403 Forbidden - Laravel 5. I have a Laravel 5.8 site web: vendor/bin/ heroku-php-apache2 public/ > Procfile git init git status git add -A� Heroku Laravel 403 Forbidden - tried all possible options but cant show page Posted 1 year ago by adrianmcg85 Cant display my webpage with Laravel 5.8.16 I have tried changing my .htaccess and Procfile but had no luck.

Getting Started with Laravel on Heroku, This guide will walk you through the configuration and deployment of a Laravel 5 application. For a general introduction to using PHP on� This guide will walk you through the configuration and deployment of a Laravel 5 application. For a general introduction to using PHP on Heroku, please refer to Getting Started with PHP on Heroku.

Heroku Deployment : laravel, It keeps on telling "403 Forbidden". Did I miss something out? Or do I need to configure some other files from my laravel project so that I can deploy it out? Heroku is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud. We stand with the Black community against racism, violence, and hate. Now more than ever we must support one another as allies and speak up for justice and equality.

Dua hari ini saya mengalami masalah saat melakukan deploy aplikasi yang saya bangun dengan framework Laravel ke server Heroku. Masalah yang saya alami adalah tidak teruploadnya database yang saya buat

Comments
  • try to add the following to the script section of your composer.json "post-install-cmd": [ "php artisan clear-compiled", "chmod -R 775 public/" ]
  • @Sehdev I tried that and update my post to show you my composer.json.
  • I don't think you correctly pointed Apache at the public directory; when I go to boss-security-2.herokuapp.com/public, I get a 500 error, but that means something is there.
  • You get 500 error ? not 403 ? How is this possible ? Can you please share screenshot ?
  • I used the script above all the time, and it works last night. I have no idea why it is not working right now .