How to turn off error reporting in php

王林
Release: 2023-03-08 15:38:01
Original
2064 people have browsed it

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

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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!