在
this question中,OP提到PHP在error_reporting关闭时自动抛出500错误,并且XDebug改变了这种行为.
这让我很好奇,因为我从未听说过PHP之前会自动发出500秒.根据SO和其他地方的各种引用和答案,如果display_errors设置为false,那么抛出500内部服务器错误标头似乎确实是PHP的默认行为.
但是,我无法找到任何正式的内容. display_errors和error_reporting的手册页什么也没说.
有没有人知道PHP文档中有一个很好的来源?
不确定,但这可能是
added in PHP 5.2.4:
- Changed error handler to send HTTP 500 instead of blank page on PHP errors. (Dmitry,Andrei Nigmatulin)
关于internals list的讨论也可能与此有关:
引用:
Current time most PHP instalations use setting ‘display_error=0’.
This setting hides errors from user but may send to him just a blank page.The proposed patch sends HTTP 500 response on errors instead of blank pages.
The pages that already wrote something are not affectd.Any objections or additions?
> http://www.mail-archive.com/internals@lists.php.net/msg28557.html