Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently testing Symfony2 with Nginx and PHP-FPM. I also use Xdebug.

Symfony2 comes with a Demo bundle, I wanted to test the new handling of fatal errors which comes with Symfony 2.2.0 by creating a syntax error in the Acme/Demo bundle. Why I do that, the server response is 502 bad gateway.

But if I make a syntax error in the file app_dev.php (so before the framework is fired), then Xdebug tells me about the fatal error.

And surprisingly, if I fix that typo, then re-create the syntax error in the Acme/Demo bundle, then Symfony error handler appears as expected. And finally if a fix all typos (page works) then again re-create that same typo (again in Acme/Bundle), I get a bad gateway.

Do you have any clue on this?

share|improve this question
Any update? I have the same issue – Kevinrob Mar 20 '15 at 9:58

This happened to me yesterday.It was an error handing off from nginx to php5-fpm turned out that the php-fpm service was configured to listen on the wrong socket.

in /etc/php5/php-fpm.conf I changed to:

listen = /var/run/php5-fpm.sock

and in all of /etc/nginx/ make sure fastcgi_pass unix:/var/run/php5-fpm.sock


share|improve this answer
Nope, my configuration works since I can use the app. It's only on this specific scenario, I described. – jchatard Mar 11 '13 at 9:51
Try changing the buffers.… – Ryan Feb 5 '15 at 2:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.