Views:
Author: Chris
<?php
ini_set(‘display_errors’, 1);
#temp. config your php.ini file for displaying errors
#you may also edit your PHP.ini file and change this manually
error_reporting (E_ALL & ~E_NOTICE);
#display errors
?>
Using error_reporting(); you can limit what errors are reported. Here’s a list of reporting levels you can use, just type error_reporting(E_YOUR CHOICE); or if you want to use more than one use error_reporting(E_YOUR CHOICE & E_YOUR SECOND CHOICE);
etc, make sure you keep intact ini_set();
E_ALL —- All errors
E_STRICT —- Recommendations and E_ALL
E_ERROR —- Run-time errors (stops the execution of a script)
E_WARNING —- Run-time warnings (does not stop the execution)
E_PRASE —- Prase Errors
E_NOTICE —- Notices (things that may or may not be problems with your script(s))
E_USER_ERROR —- User-generated errors, used by the trigger_error(); function
E_USER_WARNINGS —- Same as above, just warnings
E_USER_NOTICE —- Same again, just notices
If you are using E_ALL and don’t want to report errors from other types of error reporting you can set it out like this
error_reporting(E_ALL & ~E_THE CHOICE THAT IS NOT WANTED);
~ means discard.
Hope this helps you out a bit, comments welcome, by the way, I usually use E_ALL and if there are no errors but still issues I use E_STRICT.
Back to the Start...
1 2