Knowledgebase Home / How to Turn Off PHP Error Reporting
// View Comments //

How to Turn Off PHP Error Reporting

In this article, we’ll show you how to disable the PHP error reporting.

PHP errors are generated by your websites and logged in error_log files in the directory where your PHP files are located. If you do not need the error_log file you can disable PHP error logging.

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

php_flag display_errors off

Quick Steps:

  1. Go to your cPanel account and select File Manager.
  2. Click on Settings, check the box Show hidden files and click Save.
  3. Open the .htaccess file and add the code “php_flag display_errors off”.
  4. Click on Save Changes to save and close the file.

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

cPanel home page.

cPanel home page.

Click on Settings in File Manager.

Settings in File Manager.

Settings in File Manager.

Tick the check box “Show hidden files” and click Save.

Settings in File Manager

Select your .htaccess file and click on the Edit option from the dashboard above.

Editing the .htaccess file.

Add the code “php_flag display_errors off” and click Save Changes.


Congrats! Now, you’ve successfully turned off the PHP error reporting using the .htaccess file.

If you have any web hosting questions please feel free to reach out to us. We're happy to help.  

Our Guiding Principles

  • Provide consistent, stable, and reliable web hosting services.
  • Ensure rapid ticket response and quick resolutions to issues.
  • Never saturate or over-provision servers to ensure stability and speed for our customers.
  • Use only high-quality enterprise-class hardware to ensure minimal downtime from hardware failures.
  • Provide clear pricing with no hidden fees or gotchas.
Subscribe to comment notifications
Notify of
Inline Feedbacks
View all comments