Home >Backend Development >PHP Tutorial >Modify php.ini to block program error messages_PHP Tutorial
Provide you with some information:
display_errors = On
By default, php turns on error message display, we changed it to:
display_errors = Off
After turning off the error display, the PHP function execution error information will no longer be displayed to the user. This can prevent attackers from knowing the physical location of the script and some other useful information from the error message to a certain extent, at least to the attacker. Black box detection creates certain obstacles. These error messages may be useful to ourselves. We can let it be written to the specified file, then modify it as follows:
log_errors = Off
Change to:
log_errors = On
And the specified file, find the following line:
;error_log = filename
Remove the previous; comment and change the filename to the specified file, such as /usr/local/apache/logs/php_error.log
error_log = /usr/local/apache/logs/php_error.log
In this way, all errors will be written to the php_error.log file.