Prevent PHP Errors From Creating Large error.log File

Sometimes the error.log file can grow very large due to many PHP errors being written to it.

This could slow down your site because writing to a large error.log file takes more time.

It might also use up your disk space quota if left to grow without intervention.

The CPanel File Manager will not open error.log files over 1 MB in size. (you can delete the file and a new error.log file will automatically be created)

Preventing the errors from being written to the error.log file can be a temporary workaround to keep the site loading fast until there is time to get to the root of the problem.

In your CPanel go to Software > Select PHP Version.

Click "Switch To PHP Options" (top right).

Set "log-errors" to Off.

Click Save a bottom.

This will prevent PHP errors from being written to error.log files.

Generally it is probably best to leave log_errors off and only turn on when troubleshooting.


  • PHP
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Change PHP version

In CPanel go to Software -> Select PHP Version.There you can select the version of PHP and...

Setting Custom PHP Options with Your Own Custom php.ini File

1. In the same directory as the files you want to affect put this in the .htaccess file:It will...

Setting the PHP Timezone in the php.ini File

 If you get this error: Warning: date(): It is not safe to rely on the system's timezone...

How to see all PHP settings with a phpinfo.php File

This tutorial will show you how to make a phpinfo.php file.Create a new file using the file...

PHP 7 is Faster Than PHP 5.6

Try using the "Select PHP Version" feature in CPanel to switch to PHP 7.Be aware that this will...