The error reporting function of PHP will help you identify and locate errors. These detailed descriptions provided by PHP may also be seen by malicious attackers. Make the public unable to see the error message...
Error Report
No developer will make mistakes. PHP's error reporting function will help you confirm and locate these errors. These detailed descriptions provided by PHP may also be seen by malicious attackers. It is important that the public cannot see the error message. To do this, you only need to disable display_errors. if you want error information, you can enable the log_errors option and set the saving path of the error log file in the error_log option.
Some errors cannot be found due to the level setting of the error report. you must set error_reporting to E_ALL (E_ALL | E_STRICT is the highest setting and provide downward compatible suggestions, if not recommended ).
All error reporting levels can be modified at any level. Therefore, if you are using a shared host, you are not authorized to access php. ini, httpd. conf, or. when changing configuration files such as htaccess, you can run the error report-level configuration statement in the program:
CODE:
Tips
# The configuration of php. ini options is described in detail.
PHP also allows you to use the set_error_handler () function to specify your own error handling function:
CODE:
The above program specifies your own error handling function my_error_handler (); the following is an actual example:
CODE:
Tips
PHP 5 also allows the second parameter to be passed to set_error_handler () to limit the execution of the defined error handling function in case of any error. For example, you can create a function to handle warnings:
CODE:
The above is the PHP Security-error report content. For more information, see The PHP Chinese website (www.php1.cn )!