Home  >  Article  >  Backend Development  >  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?

王林
王林Original
2021-06-25 13:59:032121browse

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);

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!

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