Home > PHP > How to turn off PHP error reporting?

How to turn off PHP error reporting?

You can turn PHP error reporting on cPanel -> Select PHP Version -> Switch to PHP Settings section or use the following snippet in your PHP script:

error_reporting(0);

Just remember to call this before any other PHP directive.

Alternatively, you can add this line to your .htaccess file to suppress any php error messages:

php_flag display_errors off