SMacFadyen
SMacFadyen

Reputation: 3165

global php error reporting - can I include a file to stop errors displaying?

Upgrading to a new server has brought a lot of PHP errors. My site has a lot of different includes, so instead of tracking down and adding error_reporting (E_ALL ^ E_NOTICE); Is there a better way I can remove these errors?

Upvotes: 1

Views: 8980

Answers (2)

bos
bos

Reputation: 6535

ini_set('display_errors', 'off');
error_reporting(0);

Upvotes: 4

Lekensteyn
Lekensteyn

Reputation: 66375

Edit your php.ini file and set:

error_reporting = 32759

If you're using Apache, you can also set it in httpd.conf or a .htaccess file:

php_value error_reporting 32759

The numbers are looked up from: http://php.net/errorfunc.constants

Upvotes: 1

Related Questions