How to Turn Off PHP Error Reporting

In this article, we are going to understand how to disable the PHP error reporting.

PHP errors are generated by your websites and logged in error_log files within the directory wherever your PHP files are situated. If you are do not would like the error_log file you’ll disable PHP error logging.

To turn off PHP error reporting, you need to add the line as follow to your .htaccess file to suppress any PHP error messages.

php_flag display_errors off

Follow the steps as below:

Step 1: Login into your cPanel account and from the Files section open File Manager .

errorphp-1

Step 2: In File Manager Click on Settings.

errorphp-2

Step 3: Mark tick the check box “Show hidden files” and click on the Save button.

errorphp-3

Step 4: Choose your .htaccess file and from the dashboard above click on the Edit option.

errorphp-4

Step 5: Add the code “php_flag display_errors off” and press the Save Changes to update it.