Home  >  Article  >  Web Front-end  >  Setting method to open error report in PHP configuration file php.ini_javascript skills

Setting method to open error report in PHP configuration file php.ini_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:21:251317browse

How to open PHP error report for your reference.

There are many configuration settings in the php.ini file. You should have already set up your php.ini file and placed it in the appropriate directory, as shown in the documentation for installing PHP and Apache 2 on Linux.

There are two configuration variables you should be aware of when debugging PHP applications. Here are the two variables and their default values:

Copy code The code is as follows:

display_errors = Off error_reporting = E_ALL

The current default values ​​of these two variables can be found by searching for them in the php.ini file. The purpose of the display_errors variable is obvious - it tells PHP whether to display errors. The default value is Off. However, to make the development process easier, set this value to On: display_errors = On

The default value of the error_reporting variable is E_ALL. This setting will show everything from bad coding practices to harmless tips to errors. E_ALL is a bit too granular for development purposes, as it also displays hints on the screen for small things (such as variables not being initialized), which messes up the browser's output. I only want to see errors and bad coding practices, but not harmless tips. So, please replace the default value of error_reporting with the following value: error_reporting = E_ALL & ~E_NOTICE

Restart Apache and the configuration is complete.

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