In the PHP configuration file php. ini, how does one set the error report,

Source: Internet
Author: User
Tags php error

In the PHP configuration file php. ini, how does one set the error report,

Open the PHP Error Report Method for your reference.

The php. ini file contains many configuration settings. You should have set up your php. ini file and put it in the appropriate directory, as shown in instructions for installing PHP and Apache 2 on Linux.

When debugging a PHP application, you should know two configuration variables. The two variables and their default values are as follows:
Copy codeThe Code is as follows:
Display_errors = Off error_reporting = E_ALL

By searching for these variables in the php. ini file, you can find the current default values of these two variables. The purpose of the display_errors variable is obvious-It tells PHP whether an error is displayed. The default value is Off. However, to make the development process easier, set this value to On: display_errors = On.

The default value of error_reporting variable is E_ALL. This setting displays all information from poor coding practices to harmless prompts to errors. E_ALL is a little too detailed for the development process, because it displays a prompt on the screen for some trivial matters (for example, the variable is not initialized), it will mess up the browser output. I only want to see errors and bad code practices, but do not want to see harmless prompts. Therefore, replace error_reporting with the following default values: error_reporting = E_ALL &~ E_NOTICE

Restart Apache and complete configuration.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.