There are several ways to enable and disable error prompts in php: one can directly use related functions in the program to open an account, and the other can be controlled by configuring parameters in phpini.
There are several ways to enable and disable error prompts in php: one can directly use related functions in the program to open an account, and the other can use php. configure parameters in ini to control. The following section will introduce the parameters to you.
Windows system switch php error prompt
If you do not have the permission to modify php. ini, add the following code to the php file:
Ini_set ("display_errors", "On ");
Error_reporting (E_ALL | E_STRICT );
Of course, if you can modify php. ini, the code is as follows:
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 change display_errors = On in c: windows/php. ini to display_errors = off.
Solution for failure of display_errors = Off in PHP. ini
The method for enabling and disabling error messages in linux is similar, but I will introduce it to you in detail.
In linux
1. open the php. ini file.
Take my ubuntu as an example. the file is in the/etc/php5/apache2 directory.
2. search and modify the downstream, and change the Off value to On
The code is as follows: display_errors = Off
3. search for the downstream, the code is as follows:
Error_reporting = E_ALL &~ E_NOTICE or search:
Error_reporting = E_ALL &~ Modify E_DEPRECATED:
Error_reporting = E_ALL | E_STRICT
4. modify httpd. conf of Apache. Take My Ubuntu as an example. the file is in the/etc/apache2/Directory. this is a blank file and the following two lines are added:
Php_flag display_errors on
Php_value error_reporting 2039
5. restart Apache and you will be OK. Restart command: sudo/etc/init. d/apache2 restart