How to disable PHP error message echo through php. ini _ PHP Tutorial

Source: Internet
Author: User
Tags php error
Use PHP. ini to disable php error message echo. Php error display provides a lot of convenience for code debugging, allowing us to quickly locate the error. However, sometimes displaying error information can expose some sensitive information, the php error display in the program provides a lot of convenience for code debugging, allowing us to quickly locate the error. However, sometimes displaying the error information can expose some sensitive information, it has a negative impact on program security. ini configuration file, which can be closed without debugging the program, as follows:

Open PHP. ini, find display_errors, change the value to off, and set error_reporting to E_ALL. As follows:

Display_errors = Off

Error_reporting = E_ALL

You can also:

Display_errors = Off

Error_reporting = E_ALL &~ E_NOTICE

Note: If display_errors = Off is invalid, set log_errors to Off. According to official PHP documents, when log_errors is set to On, the error_log file must be specified. if the specified file is not specified or the specified file has no write permission, display_errors = Off will also be invalidated, the error message is still displayed. Therefore, if log_errors is set to Off, the problem is completely solved.

...

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.