Php enabling and disabling error messages, php enabling error messages
Windows system switch php error prompt
If you do not have the permission to modify php. ini, you can add the following code to the php file:
The Code is as follows:
Ini_set ("display_errors", "On ");
Error_reporting (E_ALL | E_STRICT );
Of course, you can modify php. ini as follows:
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/a (www.111cn.net) pache2 directory.
2. Search and modify the downstream, and change the Off value to On
The Code is as follows:
Display_errors = Off
3. Search downstream
The Code is as follows:
Error_reporting = E_ALL &~ E_NOTICE
Or search:
Error_reporting = E_ALL &~ E_DEPRECATED
Change
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.
Add the following two lines:
The Code is as follows:
Php_flag display_errors on
Php_value error_reporting 2039
5. Restart Apache and you will be OK.
Restart command ::
The Code is as follows:
Sudo/etc/init. d/apache2 restart
From: http://www.111cn.net/phper/php/53795.htm
How can I enable error prompt output in PHP?
Php. ini
Set display_errors = On to enable the error message, error_reporting = E_ALL &~ E_NOTICE: Set the error level. You can also
Ini_set ('display _ errors ', 1); // sets the enable error prompt.
Error_reporting ('e _ ALL &~ E_NOTICE '); // error level prompt
How to enable the PHP error prompt?
1,
You may have found the wrong location in the php. ini File. You can output the phpinfo () function to obtain the File corresponding to the Loaded Configuration File and modify the File.
2,
Error_reporting (0) may be set in the program );
Watch this code
Reference: www.phper163.com