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