sur l'environnement de productionest-il correct d'avoir php.ini display_errors = Sur environnement de production
Je check.php
<?php
test();
?>
Quand vous faites
curl -v http://xxx.xxx.xxx.xxx/test.php
Si php.ini sur mon l'environnement de production a et je reçois ci-dessous tête
* 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
Si je change à
display_errors=On
-je obtenir l'en-tête ci-dessous
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
Alors, quand je
display_errors=Off
I obtenir
500 Internal Server Error
Ainsi, pour éviter 500 Internal Server Error, je dois avoir display_errors = On
Est-il normal d'avoir
display_errors=On
sur l'environnement de production?
Je suis confus, pourquoi voulez-vous que le serveur de production affiche "call to undefined function ..."? Vous voulez sûrement résoudre ce problème en développement? display_errors = Dans un environnement de production, ce n'est pas une bonne idée car cela pourrait donner des indices malveillants aux parties qui pourraient les aider à exploiter votre service/système. –