Homestead 502 Bad Gateway Instead of Whoops for PHP Errors

My Homestead Vagrant virtual machine returns me 502 Bad Gateway instead of a Laravel Whoops error for some PHP errors (for example, a class was not found, some parsing errors, etc.).

Does anyone have a solution for the Whoops team for all PHP errors?

I could get the error message manually /var/log/nginx/<my_vhost>.app-error.log as follows:

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 this is very unpleasant for debugging ...

Homestead version: 0.2.0. Laravel Version: 4.2

+5
source share
2 answers

After some searching, I found a working solution.

I need to add the following lines to /etc/nginx/nginx.conf :

 http { ... fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; ... } 

Remember to edit as root with sudo

 sudo nano /etc/nginx/nginx.conf 

And then restart nginx

 sudo /etc/init.d/nginx restart 

Source of information: https://laracasts.com/discuss/channels/general-discussion/whoops-doesnt-show-any-errors-homestead-20

+12
source

my manor showed this because of the php fpm package. so i run this comment and now it works fine

 sudo apt-get install php7.0-fpm --fix-missing 
0
source

Source: https://habr.com/ru/post/1207819/


All Articles