Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel shows Symfony-styled exception even when APP_DEBUG set to false

Just deployed a new app to production and seeing a strange bug:

One of the pages has a PHP error and throws an exception. Strangely, it's a Symfony branded exception page (screenshot), different from the ones I've seen in Laravel before. Env file is already set to production environment and has APP_DEBUG=false.

Does anyone know how to fix this?

I've tried the following to clear & reset cache, but it didn't help

php artisan config:cache

Not sure if it matters, but the app was deployed using http://deployer.org with Deployer's Laravel recipe

like image 259
Brian Avatar asked Oct 29 '25 03:10

Brian


1 Answers

The mostly likely reason for this is that when deployer runs composer install, it does so with the --no-dev option, which prevents the required packages from being installed. If you want to include dev packages upon deployment, add the following to deploy.php:

set('composer_options', '--verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader');

This is the default composer_options value with --no-dev removed.

There are also slightly more complex options that include having different tasks for different hosts, which is detailed here: PHPDeployer: set variable for local task based on host?

like image 79
jgarcia Avatar answered Oct 31 '25 12:10

jgarcia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!