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
- Go to your cPanel account and select File Manager.
- Click on Settings, check the box Show hidden files and click Save.
- Open the .htaccess file and add the code “php_flag display_errors off”.
- Click on Save Changes to save and close the file.
Login into your cPanel account and open File Manager from the Files section.
Click on Settings in File Manager.
Tick the check box “Show hidden files” and click Save.
Select your .htaccess file and click on the Edit option from the dashboard above.
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.