Shielding and display of PHP error messages (errors)-set PHP. ini

Source: Internet
Author: User
If an error occurs while the PHP program is running, whether the error information is displayed in the browser, and whether the error information is displayed at the level that we need to control during the process of program development, debugging, and operation

If an error occurs while the PHP program is running, whether the browser displays the error message or not, and the level of the error message is what we need to control during the process of program development, debugging, and operation.

The following describes how to set php. ini to control the shielding and display of PHP error messages (errors:

1. whether the error message is displayed
Error display_errors = On
Blocked error display_errors = Off (default)

2. display error information level
Error_reporting = E_ALL (all)
Error_reporting = E_ALL &~ E_NOTICE (errors above Notice will be displayed)
Here we usually set it to E_ALL, and use the error_reporting () function in PHP to set the error information level of the current program.

3. set whether to save the error log.
In the process of program operation, we usually set to do not display errors, so that you can record the running status by saving the error log.
Log_errors = On (records error logs)
Log_errors = Off (not recorded)
If you save the error log, you need to set the error log to save the file at the same time.
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.