Can I disable PHP errors?

 August 27, 2011     0 Comments

Yes, you can, either by placing this code on the top of every page:

<?php error_reporting(0); ?>

Or in a .htaccess file, using:

<IfModule mod_php5.c>
  php_value error_reporting(0);

You can have various other error reporting, these include:

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized variables or catch variable
//name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE.  This is the default value set
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (see changelog)

// Report all PHP errors

How helpful was this article to you?

Powered by

FraudLabs Pro Secured Seal