PHP 5 disable strict standards error

Manny Calavera picture Manny Calavera · Aug 8, 2009 · Viewed 357.1k times · Source

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

Can anybody help ?

Answer

Nate picture Nate · Aug 8, 2009

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.

# in your PHP code:
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.