Example of configuring mask error message display and save error log in php.ini _php tutorial

Source: Internet
Author: User
Tags php error
In the course of the PHP program running, if there are errors, whether the error message is displayed on the browser, and the level of error message display is in the program development, debugging, operation process need to control.
The following is a description of the masking and display of the PHP error message (Errors) by setting php.ini, as follows:
1. Whether the error message is displayed
Copy CodeThe code is as follows: Display error display_errors = On
Mask Error display_errors = OFF (default)
2. Display the level of error messages
Copy CodeThe code is 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 information level.
3. Set whether to save the error log
In the course of the operation of the program we generally set to not display errors, so that you can save the error log to record the running status
Copy CodeThe code is as follows: Log_errors = ON (Logging error log)
Log_errors = Off (not recorded)
If you save the error log, you need to set the error log to save the file
Copy CodeThe code is as follows: Error_log = E:/php/logs/php_error.log

http://www.bkjia.com/PHPjc/769243.html www.bkjia.com true http://www.bkjia.com/PHPjc/769243.html techarticle When the PHP program is running, if there is an error, whether the error message is displayed on the browser, and the level of error messages we need in the program development, debugging, operation process ...

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