Home  >  Article  >  Backend Development  >  How does the browser display php errors?

How does the browser display php errors?

藏色散人
藏色散人Original
2021-03-02 17:58:332653browse

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.

How does the browser display php errors?

#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):
How does the browser display php errors?
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).
How does the browser display php errors?

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).
How does the browser display php errors?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to clear echo in phpNext article:How to clear echo in php