How to open a PHP error report

Source: Internet
Author: User
Tags configuration settings php error
When debugging a PHP application, you should know two configuration variables. The following are the two variables and their default values: Display_errors = Off error_reporting = E_all

Open the PHP error report method for your reference.

There are many configuration settings in the php.ini file. You should have your own php.ini file set up and put it in the appropriate directory, as shown in the documentation for installing PHP and Apache 2 on Linux. When debugging a PHP application, you should know two configuration variables. The following are the two variables and their default values: Display_errors = Off error_reporting = E_all

By searching for them in the php.ini file, you can find the current default values for both variables. The purpose of the display_errors variable is obvious-it tells PHP if it shows an error. The default value is OFF. However, to make the development process easier, please set this value to On:display_errors = On

The default value for the error_reporting variable is e_all. This setting shows all the information from bad coding practices to harmless prompts to errors. E_all is a bit too thin for the development process because it shows hints on the screen for small things (such as uninitialized variables), which can mess up the browser's output. I just want to see errors and bad coding practices, but don't want to see harmless hints. Therefore, replace the default value of error_reporting with the following values: error_reporting = e_all & ~e_notice

Reboot Apache, configuration complete.

  • 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.