在生产环境中显示php.ini_errors=可以吗

在生产环境中显示php.ini_errors=可以吗,php,php-ini,Php,Php Ini,论生产环境 我有check.php <?php test(); ?> 如果我的生产环境中的php.ini display_errors=Off 我在标题下面 * HTTP 1.0, assume close after body HTTP/1.0 500 Internal Server Error Date: Fri, 24 Jul 2015 08:10:41 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.3.29

论生产环境

我有check.php

<?php
test();
?>
如果我的生产环境中的php.ini

display_errors=Off
我在标题下面

* HTTP 1.0, assume close after body
HTTP/1.0 500 Internal Server Error
Date: Fri, 24 Jul 2015 08:10:41 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.29
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8

* Closing connection #0
HTTP/1.1 200 OK
Date: Fri, 24 Jul 2015 08:13:04 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.29
Content-Length: 119
Connection: close
Content-Type: text/html; charset=UTF-8

<br />
<b>Fatal error</b>:  Call to undefined function test() in <b>/var/www/html/check.php</b> on line <b>2</b><br />
* Closing connection #0
如果我把它改成

display_errors=On
我得到下面的标题

* HTTP 1.0, assume close after body
HTTP/1.0 500 Internal Server Error
Date: Fri, 24 Jul 2015 08:10:41 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.29
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8

* Closing connection #0
HTTP/1.1 200 OK
Date: Fri, 24 Jul 2015 08:13:04 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.29
Content-Length: 119
Connection: close
Content-Type: text/html; charset=UTF-8

<br />
<b>Fatal error</b>:  Call to undefined function test() in <b>/var/www/html/check.php</b> on line <b>2</b><br />
* Closing connection #0
我明白了

因此,为了避免500个内部服务器错误,我需要启用display_errors=On

吃点东西可以吗

display_errors=On

在生产环境中?

500内部服务器错误有什么问题?!这正是你所经历的。你的剧本错了,突然死亡;这是服务器中的内部错误。
500
响应向客户端发出信号,表示出现了一个不是客户端错误的错误,因此客户端不应使用其收到的任何响应,可能稍后重试。这正是此场景中必须发生的事情,也是
display\u errors=off
所做的事情。

我很困惑,为什么您希望生产服务器显示“调用未定义的函数…”?你肯定想在开发中解决这个问题吗?在生产环境中显示_errors=On不是一个好主意,因为它可以为恶意方提供线索,帮助他们利用您的服务/系统进行攻击。
display_errors=On