Home >Backend Development >PHP Problem >How to turn off debug mode in php

How to turn off debug mode in php

王林
王林Original
2021-02-22 14:10:574140browse

How to turn off debug mode in php: directly add the code [error_reporting(0);] in the php script. If we want to report errors other than E_NOTICE, we can add the code [error_reporting(E_ALL & ~E_NOTICE);].

How to turn off debug mode in php

The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.

The specific operations are as follows:

Close error reporting

 error_reporting(0);

Report runtime errors

 error_reporting(E_ERROR | E_WARNING | E_PARSE);

Report all errors

 error_reporting(E_ALL);

Equivalent to error_reporting(E_ALL);

 ini_set("error_reporting", E_ALL);

Report all errors except E_NOTICE

 error_reporting(E_ALL & ~E_NOTICE);

Related recommendations: php tutorial

The above is the detailed content of How to turn off debug mode in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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