The error echo of PHP provides a lot of convenience for code debugging, which allows us to quickly find the error, but sometimes displaying the error message exposes some sensitive information and negatively affects the security of the program, With the php.ini configuration file, we can close the program without debugging it as follows:
Open php.ini, find display_errors, change the following value to OFF, and set error_reporting to E_all. As shown below:
Display_errors = Off
error_reporting = E_all
The following can also be:
Display_errors = Off
error_reporting = E_all & ~e_notice
Note: If setting Display_errors = off is not effective, set the log_errors to OFF. According to the official PHP information, when the log_errors is set to ON, you must specify the Error_log file, if not specified or specified files do not have write permission, it will also invalidate the Display_errors=off, the error message will be displayed, so that the log _errors = off, the problem is solved completely.