gpt4 book ai didi

PHP 在错误时发出 500 - 这记录在哪里?

转载 作者:可可西里 更新时间:2023-10-31 23:14:31 25 4
gpt4 key购买 nike

this question OP 提到当 error_reporting 关闭时 PHP 会自动抛出 500 错误,而 XDebug 会更改该行为。

这让我很好奇,因为我以前从未听说过 PHP 会自动发出 500 秒。根据 SO 和其他地方的各种引用和答案,如果 display_errors 设置为 false,PHP 似乎确实会抛出 500 Internal Server Error header 。

但是,我无法找到关于此的任何官方信息。 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?

这里似乎显示了建议的解决方案/补丁:

关于PHP 在错误时发出 500 - 这记录在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3075355/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com