When the PHP program is running, if there is an error, whether the error message is displayed in the browser, and the level of the error message is to be controlled in the process of program development, commissioning and operation.
The following instructions are provided by setting up php.ini to control the shielding and display of the PHP error message (Errors):
1, the error message is displayed
Copy Code code as follows:
Display Error display_errors = On
Mask Error display_errors = Off (default)
2, display the error message level
Copy Code code as follows:
error_reporting = E_all (All)
error_reporting = E_all & ~e_notice (NOTICE above error will be displayed)
Here we are generally set to E_all, in the PHP program using the error_reporting () function to set the current program error message level.
3. Set whether to save error log
In the process of operation, we generally set to do not display errors, so you can save the error log to record the running state
Copy Code code as follows:
Log_errors = ON (Logging error log)
Log_errors = off (not logged)
If you save the error log, you need to set the error log to save the file at the same time
Copy Code code as follows:
Error_log = E:/php/logs/php_error.log