There are several ways to open and close the error prompt in PHP you can use the relevant functions directly in the program to open an account, the other we can use the configuration parameters in the php.ini to control, the following small part to introduce you to the students.
Windows system switch PHP error prompt
If you do not have permission to modify php.ini, you can add the following code to the PHP file:
| The code is as follows |
Copy Code |
Ini_set ("Display_errors", "on"); Error_reporting (E_all | E_STRICT); |
Of course, if you can modify the php.ini, as follows:
| The code is as follows |
Copy Code |
Find display_errors = on modified to Display_errors = Off Note: If you have copied the php.ini file to the Windows directory, you must also change the Display_errors = on in C:windows/php.ini to Display_errors = Off Resolution for display_errors = off invalidation in PHP. ini |
On the Linux system to turn on and off the error prompt the same way, but I would like to give you a specific introduction
Under Linux system
1. Open the php.ini file.
Take my Ubuntu example, this file is in the following:/etc/php5/apache2 directory.
2. Search and modify the downstream, change the off value to on
| The code is as follows |
Copy Code |
| Display_errors = Off |
3. Search downstream
| The code is as follows |
Copy Code |
error_reporting = E_all & ~e_notice or search: error_reporting = E_all & ~e_deprecated Revision changed to error_reporting = E_all | E_strict |
4. Modify Apache's httpd.conf,
Take my Ubuntu example, this file is in the:/etc/apache2/directory, which is a blank file.
Add the following two lines:
| The code is as follows |
Copy Code |
Php_flag display_errors on Php_value error_reporting 2039 |
5. Restart Apache and it will be OK.
Restart command::
| The code is as follows |
Copy Code |
Sudo/etc/init.d/apache2 restart
|
http://www.bkjia.com/PHPjc/632675.html www.bkjia.com true http://www.bkjia.com/PHPjc/632675.html techarticle There are several ways to open and close the error prompt in PHP, you can use the relevant function directly in the program to open an account, another we can use the configuration parameters in the php.ini to control, the following small ...