In this the OP mentions PHP tossing a 500 error instantly when error_reporting is off, and XDebug altering that behavior.

That got me curious, as I have never heard about PHP instantly giving off 500s before. Based on various quotes and solutions on SO and elsewhere, it appears to indeed be PHP's default behavior to throw a 500 Internal Server Error header if display_errors is placed to false.

However, I'm not able to locate anything official about this. The manual pages on display_errors and error_confirming say nothing.

Does anybody know a great source within the PHP paperwork that discusses this?

Unsure, but this might have been put in PHP 5.2.4:

  • Transformed error handler to transmit HTTP 500 rather than blank page on PHP errors. (Dmitry, Andrei Nigmatulin)

There's also this discussion around the internals list that could be related:


Current time most PHP instalations use setting 'display_error=0'. This setting hides errors from user but may send to him only a blank page.

The suggested patch transmits HTTP 500 response on errors rather than blank pages. The web pages that already authored something aren't affectd.

Any objections or additions?

and also the suggested solution/patch appears to become proven here: