PHP: dual output php errors / warnings / notifications

If I execute the following script:

<?php
error_reporting(E_ALL);
trigger_error('test notice', E_USER_NOTICE);
die('end of script');

I get the following output:

<br />
<b>Notice</b>:  test notice in <b>path/to/script/test.php</b> on line <b>3</b><br />
end of scriptPHP Notice:  test notice in path/to/script/test.php on line 3

The script was run on IIS8 with PHP version 5.4.19.

The returned http status code is 200.

"display_errors" is set to "On" and "error_reporting" to "E_ALL" in the php.ini file. Therefore, the first line of the script is for clarification only.

The behavior is the same with all error message constants (E_ERROR, E_WARNING, etc.).

Does anyone know where the second notification output comes from? And especially, how to get rid of it?

+4
source share
3 answers

, IIS: "Connect As" IIS_USER php ! , , , , .

0

error_reporting(E_ALL);
ini_set('display_errors', 1);

:

PHP: Undefined: test in /path/to/ script.php 8

: Undefined: test in /path/to/ script.php 8

, .

+2

script

error_reporting(E_ALL);
PHP display_errors, PHP, PHP , , .
0

Source: https://habr.com/ru/post/1534474/


All Articles