Laravel localhost works, but heroku gives 500 error Laravel localhost works, but heroku gives 500 error laravel laravel

Laravel localhost works, but heroku gives 500 error


Set 2 config variables in heroku with following commands:

1 heroku config:set APP_DEBUG=true
2 heroku config:set APP_KEY=RandomString

After setting these keys you will be able to see the actual error instead of general 500.


For problem with key in heroku add this code in config/app.php:

'key' => env('APP_KEY', 'SomeRandomStringSomeRandomString'),

In terminal write this command

heroku config:set APP_KEY=SomeRandomStringSomeRandomString


Try this heroku config:set APP_DEBUG=true then visit your app and see what's exactly is the error. Most likely is database connection failing or missing .env key.