Home > Backend Development > PHP Problem > What is the method to modify the php.ini file to turn off warning errors?

What is the method to modify the php.ini file to turn off warning errors?

王林
Release: 2023-03-10 21:40:01
Original
2235 people have browsed it

The method to modify the php.ini file to turn off warning errors is: first open the php.ini configuration file in the php installation directory; then find [display_errors=on]; and finally modify [display_errors=off].

What is the method to modify the php.ini file to turn off warning errors?

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

To turn off warning errors in PHP, the simplest way is to add the following code directly to the PHP program code:

error_reporting(E_ALL^E_NOTICE^E_WARNING);
Copy after login

The above can turn off all notice and warning level errors.

Put this statement in the function include file of your script, usually config.php or conn.php to control the output.

Of course we can also set it in php.ini as follows:

Open the php.ini file in the PHP installation directory;

Find display_errors = On and change it to display_errors = off.

Related video sharing: php video tutorial

The above is the detailed content of What is the method to modify the php.ini file to turn off warning errors?. 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