Example _ PHP Tutorial-PHP Tutorial

Source: Internet
Author: User
In PHP. ini, configure the example of blocking error information and saving error logs. If an error occurs while the PHP program is running, check whether the error message is displayed in the browser, the error information is displayed in the browser if an error occurs during the PHP program development, debugging, and operation, and the level of error information that we need to control in 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

The code is as follows:

Error display_errors = On
Blocked error display_errors = Off (default)


2. display error information level

The code is as follows:

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.

The code is as follows:

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.

The code is 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.