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);].
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!