How to turn off PHP error message echo by php.ini

Source: Internet
Author: User
Tags ini php error

The error echo of PHP provides a lot of convenience for code debugging, which allows us to quickly find the error, but sometimes displaying the error message exposes some sensitive information and negatively affects the security of the program, With the php.ini configuration file, we can close the program without debugging it as follows:

Open php.ini, find display_errors, change the following value to OFF, and set error_reporting to E_all. As shown below:

Display_errors = Off

error_reporting = E_all

The following can also be:

Display_errors = Off

error_reporting = E_all & ~e_notice

Note: If setting Display_errors = off is not effective, set the log_errors to OFF. According to the official PHP information, when the log_errors is set to ON, you must specify the Error_log file, if not specified or specified files do not have write permission, it will also invalidate the Display_errors=off, the error message will be displayed, so that the log _errors = off, the problem is solved completely.

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.