The easiest way to do this is to add the following code directly to the PHP program code:
The code is as follows |
|
Error_reporting (e_all^e_notice^e_warning); |
You can turn off all notice and warning-level errors.
Put this statement in the functional inclusion file of your script, usually config.php or conn.php to control the output.
Of course, I can also be set in the PHP.ini method is as follows
Open the php.ini file under the PHP installation directory
Find display_errors = on modified to Display_errors = Off
Note: If you have copied the php.ini file to the Windows directory, you must also modify the Display_errors = on in C:windows/php.ini to Display_errors = Off
Solution of display_errors = off failure in PHP. ini
Problem:
PHP settings file PHP. ini is already set display_errors = off, but in the running process, the page will still appear error messages.
Solve:
Open the php.ini file under the PHP installation directory
Find log_errors = off modified to Log_errors = On
Find error_log = filename modified to error_log= "D:phperrlogphp_error.log" (Here's the directory and filename d:phperrlogphp_error.log whatever you take)
Note: If you have copied the php.ini file to the Windows directory, you must also c:windows/php.ini the file.
In addition, Php_error.log must have at least user modification and write permissions, otherwise the error log cannot be exported.
Often see error_reporting (7) Direct meaning: Set the wrong message return level.
Value constant
1 E_error
2 e_warning
4 E_parse
8 E_notice
E_core_error
E_core_warning
E_compile_error
128 E_compile_warning
256 E_user_error
E_user_warning
1024 E_user_notice
2047 E_all
2048 e_strict
However 7=1+2+4
is to show 1 E_error 2 e_warning 4 e_parse when something goes wrong