Home >Backend Development >PHP Problem >How to avoid displaying warnings in php
How to not display warnings in php: First find the corresponding configuration file [php.ini]; then look for the [display_errors] attribute; finally change it to Off, save and restart.
How to not display warnings for php:
1. First, determine the version of PHP in your project, and then Find the corresponding configuration file php.ini, and press Ctrl F under Windows to find the display_errors attribute. If the original value is On, then change it to Off, then save it, and restart the server to remove the Warning prompt.
#2. If there are still warnings on the page after setting the display_errors attribute to Off, then open your phpinfo() and check the configuration information. Ctrl F finds the display_errors attribute. If the values of Local Value and Master Value are inconsistent, it means that you have set local values elsewhere, which affects the global attributes.
3. You can Ctrl Shift F to search the display_errors attribute globally in your project. This value must be additionally set in other configuration files.
#4. After finding it, set the value of the display_errors attribute to Off, save the file and open the program again to see if there is still a Warning prompt.
If you want to learn more about programming, please pay attention to the php training column!
The above is the detailed content of How to avoid displaying warnings in php. For more information, please follow other related articles on the PHP Chinese website!