When using php for website development, an unfriendly interface appears to Prevent Users From seeing error messages. Therefore, display_errorsOff is usually set in php. ini. However, during development, we sometimes need to open the error message. At this time, you can set ini_set (display_errors, On); error_reportin in the PHP file.
When using php for website development, an unfriendly interface appears to Prevent Users From seeing error messages. Therefore, we usually set display_errors = Off in php. ini. However, during development, we sometimes need to open the error message. At this time, you can set ini_set (display_errors, On); error_reportin in the PHP file.
When using php for website development, an unfriendly interface appears to Prevent Users From seeing error messages. Therefore, the general settings will be set in php. ini:
Display_errors = Off;
However, during development, we sometimes need to open the error message. At this time, you can set in the PHP file:
Ini_set ("display_errors", "On ");
Error_reporting (E_ALL );
However, sometimes we set this in time and still cannot display the syntax errors in php.
This is because the PHP File Syntax Error causes the file to be not executed at all, so the error message is certainly not displayed.
Solution:
Suppose there is a syntax error in php.
You can create a new test. php
Edit the following content in the php file:
Ini_set ("display_errors", "On ");
Error_reporting (E_ALL );
Include ("target file ");
In this way, when you are running test. php, the program will report the error syntax.
Original article address: Go to: PHP debugging error. Thank you for sharing it.