This article summarizes the usage of phpdisplay_errors and log_errors. For more information, see this article. Error Echo, which is commonly used in development mode. However, many applications forget to disable this option in the formal environment. Error Echo can expose non-
This article summarizes the usage of php display_errors and log_errors. For more information, see this article.
Display_errors
Error Echo, which is commonly used in development mode. However, many applications forget to disable this option in the formal environment. error Echo can expose a large amount of sensitive information to facilitate the next attack. disable this option.
Display_errors = On
If an error occurs in the Enabled status, an error is returned.
Dispaly_errors = Off
If an error occurs in the off status, the system prompts: Server Error. but no error prompt appears.
You can define the switch in the program.
// Ini_set ("display_errors", "On"); // display all error messages */
Ini_set ("display_errors", "Off"); // block all error messages
It should be noted that, in the server configuration file, notice errors are blocked and only error errors are displayed. if so, you can enable the error display without displaying notice errors.
Log_errors
Use this in the official environment and record the error information in the log. you can close the error echo function.
Set whether to record the error information of script running to the server error log or error_log. Note that this is a specific configuration item related to the server.
Note:
In the production system, it is strongly recommended that you use error logs to record the error information displayed on the web site.
Log_errors_max_len integer
Set the maximum number of log_errors bytes. the error source information is added to error_log. the default value is 1024. if it is set to 0, the length is not limited. this length is set to the error of the record, the error displayed, and $ php_errormsg will be used for limited production.
When integer is used, its value is measured in bytes. you can also use the stenographer described in the FAQ.