Home  >  Article  >  Backend Development  >  How to turn off error reporting in php

How to turn off error reporting in php

王林
王林Original
2021-03-10 17:09:362077browse

php method to turn off error reporting: first open the php.ini configuration file; then search for display_errors in the file; finally change [display_errors = Off] to [display_errors = On].

How to turn off error reporting in php

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

The specific method is as follows:

First find the php configuration file, which is php.ini;

Then search for 'display_errors' in the file and find display_errors = Off or display_errors = On, Off means turning off error prompts, On means turning on error prompts, you can modify it according to your needs.

You can also add the following code to the php file

//禁用错误报告
error_reporting(0);
//报告运行时错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//报告所有错误
error_reporting(E_ALL);

Related recommendations:php tutorial

The above is the detailed content of How to turn off error reporting 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