Home > Backend Development > PHP Tutorial > How to turn off php error message echo through PHP.ini_PHP Tutorial

How to turn off php error message echo through PHP.ini_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:32:03
Original
865 people have browsed it

PHP’s error echo provides a lot of convenience for code debugging, allowing us to quickly find the error. However, sometimes displaying error messages will expose some sensitive information and have a negative impact on program security. Therefore, through the php.ini configuration file, we can turn it off when not debugging the program. The method is 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 is also possible:

display_errors = Off

error_reporting = E_ALL & ~E_NOTICE

Note: If setting display_errors = Off does not work, please set log_errors to Off. According to PHP official information, when log_errors is set to On, the error_log file must be specified. If it is not specified or the specified file does not have write permission, display_errors=Off will also be invalidated, and the error message will still be displayed, so, log_errors = Off, the problem is completely solved.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/756843.htmlTechArticlephp’s error echo provides a lot of convenience for code debugging, allowing us to quickly find the error, but sometimes , displaying error messages will expose some sensitive information, which will affect the program...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template