If an error occurs while the PHP program is running, whether the browser displays the error message or not, and the level of the error message is what we need to control during the process of program development, debugging, and operation.
The following describes how to set php. ini to control the shielding and display of PHP error messages (errors:
1. Whether the error message is displayed
Copy codeThe Code is as follows: the error display_errors = On is displayed.
Blocked error display_errors = Off (default)
2. Display Error information level
Copy codeThe Code is as follows: error_reporting = E_ALL (all)
Error_reporting = E_ALL &~ E_NOTICE (errors above Notice will be displayed)
Here we usually set it to E_ALL, and use the error_reporting () function in PHP to set the error information level of the current program.
3. Set whether to save the error log.
In the process of program operation, we usually set to do not display errors, so that you can record the running status by saving the error log.
Copy codeThe Code is as follows: log_errors = On (records error logs)
Log_errors = Off (not recorded)
If you save the error log, you need to set the error log to save the file at the same time.
Copy codeThe Code is as follows: error_log = e:/php/logs/php_error.log