Setting method to open Error Reporting in PHP configuration file php.ini _javascript tips

Source: Internet
Author: User
Tags configuration settings

Open the method of error Reporting in PHP for your reference.

There are many configuration settings in the php.ini file. You should have set up your own php.ini file and put it in the appropriate directory, as shown in the documentation Instructions for 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:

Copy Code code as follows:

Display_errors = off error_reporting = E_all

By searching for them in the php.ini file, you can find the current default values for these two 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, set this value to On:display_errors = On

The default value for the error_reporting variable is e_all. This setting displays all information from bad coding practices to harmless hints to errors. E_all is a bit too thin for the development process because it displays hints on the screen for trivial things, such as variable initialization, and 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 error_reporting default value with the following values: error_reporting = e_all & ~e_notice

Reboot Apache, complete configuration.

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.