加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PHP错误排放500 – 这在哪里记录?

发布时间:2020-12-13 13:08:38 所属栏目:PHP教程 来源:网络整理
导读:在 this question中,OP提到PHP在error_reporting关闭时自动抛出500错误,并且XDebug改变了这种行为. 这让我很好奇,因为我从未听说过PHP之前会自动发出500秒.根据SO和其他地方的各种引用和答案,如果display_errors设置为false,那么抛出500内部服务器错误标头似
在 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的讨论也可能与此有关:

> [PHP-DEV] FW: php fastcgi

引用:

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读