I\'m working on an existing Laravel application in order to develop new feature but after installing the app on my computer, I have an error 500 and no clue to resolve it.
I had simiar issue (saw error 500, but logs were present).
In order to be able to see errors directly on the page, I did following changes:
APP_DEBUG=true
php artisan config:cache
Next to looking into your .env
file, make sure permissions are correctly set (and good practice to create the storage/logs
folder(s) manually - at least on windows that causes problems).
I tried to everything to find out the issue like enabling error reporting to report all like :
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Also i tried to add my custom error handler as well but nothing worked for me. So finally i found the actual issue in php error log file in apache error logs folder (Applications/MAMP/logs
as am using Mac).
Some PHP exceptions are not possible to catch, so Laravel cant handle them. For example syntax errors, or maximum memory limit errors.
The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.
Ref.: http://php.net/manual/en/function.set-error-handler.php
Check your .htaccess file in your public folder! - This hot-fix is host dependent!!!
Change line from:
RewriteRule ^ index.php [L]
To:
RewriteRule ^ /index.php [L]