Laravel shows errors even when debug mode disabled

Hello! I’ve just deployed a new app to production and seeing a strange bug:
Laravel shows errors in Browser even when debug mode is disabled

Here is my app.php file contents:
‘env’ => env(‘APP_ENV’, ‘production’),
‘debug’ => (bool) env(‘APP_DEBUG’, false),

Check error logs

the domain.error.log file is empty

Then enable laravel error logs / debugging what ever…

Impossible to guess

I mean that Laravel shows the php errors when they are even when debug mode is disabled. The showing errors isn’t good for security. I can’t understand why when the ‘debug’ => (bool) env(‘APP_DEBUG’, false), is disabled it continues showing errors.

Being a Laravel developer (since v4) I can almost guarantee you that the problem will be that you’ve not cleared/re-cached the Laravel config cache after making the changes…

You should login to the terminal (SSH into your HestiaCP account) and run these commands:

cd ~/web/{website}/public_html
php artisan config:cache

PS. If you regularly just upload changed files (and not the re-cached files) you might want to disable config caching altogether on the server… Let me know if you want to do that and if you need help with that - there will be a very small performance hit but may save you the hassle in future.

Hope this helps :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.