php method to turn off web page error prompts: directly add the code [error_reporting(E_ALL^E_NOTICE^E_WARNING);] to the php program, so that all notice and warning level errors can be turned off.
Turning off the PHP error script prompt is something that must be done when the program is online. No matter how the program reports an error, we cannot let the error log be posted to everyone on the server. See.
(Video tutorial recommendation: java video tutorial)
The easiest way is to add the following code directly to the php program code:
error_reporting(E_ALL^E_NOTICE^E_WARNING);
This 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
1. Open the php.ini file in the PHP installation directory
2. Find display_errors = On and change it to display_errors = off
Note: If you have copied the PHP.ini file to the windows directory, you must also change display_errors = On in c:windows/php.ini to display_errors = off
Related recommendations: php training
The above is the detailed content of How to turn off web page error prompts in php. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Linux new version
SublimeText3 Linux latest version
