My Homestead Vagrant virtual machine is returning me a 502 Bad Gateway
instead of a Laravel Whoops error for some PHP errors (like class not found, some kind of parse errors etc ...).
Does someone have the solution for briging Whoops for all PHP errors ?
I could get the error reading manually /var/log/nginx/<my_vhost>.app-error.log
like this :
2014/11/27 15:15:44 [error] 1300#0: *12 FastCGI sent in stderr: "PHP message: PHP Fatal error: <ERROR HERE> on line <LINE>
But it is very annoying for debugging ...
Homestead version : 0.2.0. Laravel version : 4.2
After some searches I found a working solution.
I have to add the following lines to my /etc/nginx/nginx.conf
:
http {
...
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
...
}
Dont forget to edit with root rights with sudo
sudo nano /etc/nginx/nginx.conf
And then restart nginx
sudo /etc/init.d/nginx restart
Source of the info : https://laracasts.com/discuss/channels/general-discussion/whoops-doesnt-show-any-errors-homestead-20
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With