mikelovelyuk mikelovelyuk - 1 year ago 77
PHP Question

Laravel errors not working

Whenever my code has an error.. All I get on the browser is a blank white page. No errors. Nothing.

I have tried turning

in config/app.php. I have tried running
php artisan optimize
. No difference. I have tried this post and this is the resulting error in my command line;

The following exception is caused by a lack of memory and not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details
PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:974
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 974, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(974): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(784): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(745): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(675): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 974

So here is another problem to deal with... and I still don't have errors showing. I just want to show some meaningful errors... what else can I try?


I followed this guide as suggested in the error message above. I got a pretty positive looking response;

1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 1.6144 s, 665 MB/s

So I tried running
composer update
again. I got this response;

Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing laravel/framework (v5.0.5)
- Installing laravel/framework (v5.0.6)
Downloading: 100%

- Installing filp/whoops (1.1.3)
Loading from cache

Writing lock file
Generating autoload files
Generating optimized class loader
Compiling common classes
Compiling views

All good, right? But then, I still get a blank white page when loading my script with an error. Why??

Answer Source

You get that error because Composer ran out of memory (it happens), how to fix this, see this for example: Composer update trouble

You could try to change the memory limit, or if you're developing locally and you get that error on your server; keeping the composer.lock-file in your git-repository (or where/whatever you use to deploy your project).

Now, you are probably getting the white page because the framework actually isn't loaded (so the "debug" => true isn't even read).