I\'m working in a project that needs to convert some data from excel to database. This is working fine in local host with laravel, but when goes to heroku, it gives me a 500 int
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
After some more hours trying to figure out what is going on with the code, I discovered that it was a problem with the Apache timeout.
I found the answer here.
Credits: Eric Cope
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.
I discovered the why I had the 500 error. It was because I was putting date configuration wrong.
So, this post solved my problem.
During the study to find the error, I discoverd that laravel has a debug messages when deploy too. So I change the debug mode to true.
directory: "laravel/config/app.php"
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG', true),
I also want to add that I encountered this as well, but it was because I forgot to add the APP_KEY
for the Heroku app.
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.