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

How to turn off debug mode in php

王林
Release: 2023-03-08 07:34:01
Original
4093 people have browsed it

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);
Copy after login

Report runtime errors

 error_reporting(E_ERROR | E_WARNING | E_PARSE);
Copy after login

Report all errors

 error_reporting(E_ALL);
Copy after login

Equivalent to error_reporting(E_ALL);

 ini_set("error_reporting", E_ALL);
Copy after login

Report all errors except E_NOTICE

 error_reporting(E_ALL & ~E_NOTICE);
Copy after login

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!

Related labels:
php
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