Example of configuring masking error messages in php.ini to display and save error logs _php tips

Source: Internet
Author: User
Tags php error
When the PHP program is running, if there is an error, whether the error message is displayed in the browser, and the level of the error message is to be controlled in the process of program development, commissioning and operation.
The following instructions are provided by setting up php.ini to control the shielding and display of the PHP error message (Errors):
1, the error message is displayed
Copy Code code as follows:
Display Error display_errors = On
Mask Error display_errors = Off (default)

2, display the error message level
Copy Code code as follows:
error_reporting = E_all (All)
error_reporting = E_all & ~e_notice (NOTICE above error will be displayed)

Here we are generally set to E_all, in the PHP program using the error_reporting () function to set the current program error message level.
3. Set whether to save error log
In the process of operation, we generally set to do not display errors, so you can save the error log to record the running state
Copy Code code as follows:
Log_errors = ON (Logging error log)
Log_errors = off (not logged)

If you save the error log, you need to set the error log to save the file at the same time
Copy Code code as follows:
Error_log = E:/php/logs/php_error.log

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.