PHP gives different error hints for different severity errors at run time.
Development, in order to standardize the program, the error level to higher, notice level of the report, to help quickly locate errors and code specifications. In the product line, the site operation process, it is not appropriate to report so many wrong, 1: This error to the customer's impression is not good; 2: in error, the absolute path of the website is reported, increase the risk of attack, therefore, in the website after the online, should let the error level down, less reported or even not reported.
Setting the error Reporting level
1: Modify error_reporting option in PHP.ini, 2: Can be modified in PHP page, error_reporting () function.
The error level is represented by a value of 2, 1111 1111 1111 111, left to Yes, and 1 on each, representing an error level.
E_error fatal error: 0000 0000 0000 001 Open
E_warning warning error: 0000 0000 0000 010 Open
E_parse syntax error: 0000 0000 0000 100 Open
E_notice warning: 0000 0000 0001 000 Open
E_all all errors: 1111 1111 1111 111 Open
1<?PHP2 Define(' DEBUG ',true);//at development time, declare a debug mode3 if(defined(' DEBUG ')) {4 error_reporting(E_all);//all errors are reported in development mode5}Else {6 error_reporting(0);//after the line, no error7 }8 Echo $a+$b;//Newspaper Notice9 Echo3/0;//Newspaper WarningTen EchoASDF ();//Report fatal error One?>
PHP Error Reporting settings