4

My server is setup with Nginx + PHP + FastCGI. Whenever PHP throws a Fatal error, it gets logged inside of nginx/error.log, but the server reports HTTP Error 500 back to the browser instead of displaying the PHP Fatal error to the browser as is desired and typical in other setups. I've been searching for how to resolve this and keep coming up short. Anyone have anything helpful about this? Much appreciated!

7
  • 1
    Do you have display_errors enabled? Commented Mar 15, 2011 at 20:27
  • display_errors is set to "On" in php.ini, and I made sure it was the only php.ini on the system Commented Mar 15, 2011 at 20:54
  • What FastCGI process manager are you using, and what PHP version? Commented Mar 15, 2011 at 21:23
  • PHP 5.3.2. Plain old FastCGI that needs to be started using this command: php-cgi -b 127.0.0.1:9000 & Commented Mar 17, 2011 at 4:07
  • 1
    Hm. What's the value of the ini setting fastcgi.logging? Are you able to update to 5.3.3 or better and try the new, built-in FPM FastCGI interface? Commented Mar 17, 2011 at 4:21

2 Answers 2

7

Found it!

As of PHP 5.2.4, the default is now to cause a 500 error, because the alternative is an empty page.

Other discussions suggest that this behavior can not be changed for the "PHP Fatal" error type, which don't flow through the normal error handler routines and can not be caught or stopped.

Sign up to request clarification or add additional context in comments.

Comments

2

You probably have php_errors off (or the displaying of them) in your php loader script... Try checking your php.ini settings...

1 Comment

display_errors is set to "On" in php.ini, and I made sure it was the only php.ini on the system

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.