tags:

views:

4888

answers:

2

Hello. I need to setup my PHP script at the top to disable error reporting for strict standards.

Can anybody help ?

+2  A: 

For no errors.

error_reporting(0);

or for just not strict

error_reporting(E_ALL ^ E_STRICT);

and if you ever want to display all errors again, use

error_reporting(-1);

Chacha102
doesn't work for me
clinisbut
+8  A: 

Do you want to disable error reporting, or just prevent the user from seeing it? It’s usually a good idea to log errors, even on a production site.

ini_set('display_errors', '0');     # don't show any errors...
error_reporting(E_ALL | E_STRICT);  # ...but do log them

They will be logged to your standard system log, or use the error_log directive to specify exactly where you want errors to go.

Nate