Home > Article > Backend Development > What to do if php does not print errors
Solution to php not printing errors: First open the php.ini configuration file; then modify [display_errors = On]; finally modify [error_reporting = E_ALL | E_STRICT].
There are two methods to solve this problem, namely:
1. Modify php. ini file
; 第一处修改 ; display_errors = Off display_errors = On ; 第二处修改 ; error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT error_reporting = E_ALL | E_STRICT
2. Call the following function at the beginning of the php file
//禁用错误报告 error_reporting(0); //报告运行时错误 error_reporting(E_ERROR | E_WARNING | E_PARSE); //报告所有错误 error_reporting(E_ALL);
If you want to learn more about programming, please pay attention php training column!
The above is the detailed content of What to do if php does not print errors. For more information, please follow other related articles on the PHP Chinese website!