Home > Article > Backend Development > How does the browser display php errors?
How to set up the browser to display PHP errors: 1. Modify "display_errors=On" in the php.ini file; 2. Open the IE browser and check "Show friendly http error messages"; 3. To turn on the debugging mode of the browser, check the php error message.
#The operating environment of this article: Windows 7 system, PHP version 7.1, Dell G3 computer.
The browser prints PHP error information (used for web debugging)
1. Modify the php.ini file
Open the php.ini file in the php installation directory and modify the "display_errors" line to "display_errors = On" (as shown below) shown):
After saving, close the file and restart the web server.
2. Modify browser settings
Open IE browser, select "Tools"->"Internet Options" in the upper right corner; select Advanced (as shown in the figure below) Show).
Then click OK to save.
3. View the PHP error message:
If the browser turns on the debugging mode, you can see the PHP error message (as shown in the figure below).
4. Turn off PHP to display prompt-level information
When display_errors is turned on, prompt-level php output will cause php Unable to execute normally (for example, the variable is defined as $beginTime = $_POST['beginTime'];)
In php.ini, line 302 error_reporting = E_ALL
is modified to
error_reporting = E_ALL & ~E_NOTICE and then restart the server.
[Recommended learning: "PHP Video Tutorial"]
The above is the detailed content of How does the browser display php errors?. For more information, please follow other related articles on the PHP Chinese website!