Websites generate PHP errors and log in error_log files in the directory where your PHP files are placed. In case you don’t require the error_log file, PHP error logging can be disabled using a simple code.
Steps to Turn Off PHP Error Reporting
Login into your cPanel account and go to the Files section and click on the File Manager.
In the File Manager, click on Settings.
Check the box for the field “Show hidden files” and click on Save.
Select the .htaccess file and click on Edit from the above section.
Now, just add the below code and click on Save Changes.
php_flag display_errors off
Congrats! You have now learned to turn off the PHP error reporting using the .htaccess file.