PHP debugging technology

Source: Internet
Author: User

PHP Error Report

The PHP. ini file contains many configuration settings.

Debugging PHP applicationsProgramYou should know two configuration variables. The two variables and their default values are as follows:

 
Display_errors = offerror_reporting = e_all

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

 
Display_errors = on

Error_reportingThe default value of the variable isE_all. This setting displays all information from poor coding practices to harmless prompts to errors.E_allThe development process is a little too detailed, 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 the following valuesError_reportingDefault Value:

 
Error_reporting = e_all &~ E_notice

Restart Apache and set all the settings.

 

 

Server Error Report

 

Add the following lines to httpd. conf to overwrite any PHP. ini file:

Php_flag display_errors onphp_value error_report 2039

This will be overwritten in the PHP. ini fileDisplay_errorsThe configured flag andError_reporting. Value2039RepresentativeE_all &~ E_notice. If you want to useE_all, Set the value2047. Similarly, restart Apache.

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.