Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AIH's avatar
Level 2

Whoops doesn't show any errors. Homestead 2.0

I have fresh install of Homestead 2.0 All works fine, but when my app throw any error, a I see default nginx error page.

502 Bad Gateway

nginx/1.6.2

Maybe I need turn on Whoops or smth lile that?

0 likes
12 replies
igaster's avatar

Latest push has changed the error handling in L5.

check your Bootstrap\app.php and change

$app->singleton(
 'Illuminate\Contracts\Debug\ExceptionHandler',
 'Illuminate\Foundation\Debug\ExceptionHandler' 
);

to:

$app->singleton(
  'Illuminate\Contracts\Debug\ExceptionHandler',  
  'Illuminate\Foundation\Exceptions\Handler'
);

Edit: sorry, applies only to Laravel 5-dev

zgames's avatar

fix your permissions for storage folder to 777

and do 'php artisan serve', if you go to localhost:8000 it should fix the problem for now, cus I'm out of ideas here

zgames's avatar

deleting old virtual machines at virtual box application will solve the problem

bashy's avatar

502 Bad Gateway won't even reach Laravel. Check your php5-fpm config and make sure it's receiving via Nginx

AIH's avatar
Level 2

Bashy, I ran Homestead with default configuration. By default, Laravel doesn't catch errors and exceptions? And, what I should change in config of php5-fpm?

bashy's avatar

Check the logs for php5-fpm in /var/logs/

AIH's avatar
AIH
OP
Best Answer
Level 2

Adding two lines to Nginx configuration file /etc/nginx/nginx.conf solve my problem:

http {
...
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
...
}
4 likes
hootlex's avatar

@LIS you are a genius! solution worked with laravel 5!

2 likes
andy1786's avatar

i tried adding those two lines and still when i try to load my site example.app im getting a 502 gateway

2 likes
Cronix's avatar

@cilyan The thread is 3 years old. The last post before yours was Jan 8, 2016. Take that into consideration when looking for current solutions.

Please or to participate in this conversation.