Contact Support : +64 220 256 070

Aimvm
Blog

How to enable PHP error reporting on your cPanel account?

Posted on: October 7, 2014

This lesson will teach you on how to enable PHP error reporting on your site.

The PHP error_reporting() function specifies which errors are reported.  Using this function, you can identify which errors which are reported for the duration of the current script.  The best way to debug this would be to enable error reporting in PHP through your .htaccess

Here is how you can do it.

Steps:

1) Login to your cPanel account.

2) Open ‘File Manager’

3) Go to the document root location of the account you want to enable error reporting.

4) Open the ‘.htaccess’ file. You can create it if it is not available already.

5) Add the following line of code to it.

php_flag display_errors on
php_value error_reporting “E_ALL & ~E_STRICT & ~E_NOTICE”

Now the errors will start to display on the site itself and it will help you/developer to debug the php scripts.

You can use the following code to disable this function.

error_reporting(0);

 

Search Blog