php suppress errors

Posted 30 March, 2009 in Other Stuff

When you have your PHP script up and running on the web, you might want to suppress any errors as they can show visitors some of the inner workings of your scripts.

Here are three basic levels of error suppresson or lack of it:

error_reporting(0); // Suppress all errors
ini_set (“display_errors”, “1″); // Suppress all but fatal errors
error_reporting(E_ALL); // Show all errors. Good for debugging

For more on this see:

http://uk.php.net/error_reporting

Also you can put an at “@” before any function to suppress errors it might generate.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz

-*O*-