Home >Backend Development >PHP Problem >What is the method to modify the php.ini file to turn off warning errors?
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].
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!