Remove All Error Logs

In a WHM environment you might run into issues with your clients using outdated code that generates lots of error codes. By default cPanel/WHM writes errors to the users log directory. 

PHP Error log location for


Sometimes if left unchecked PHP error logs can balloon in size, I’ve seen logs in excess of 5GBs. The below command will wipe all PHP error logs on the server. A great way to free up space, but will leave you and your clients unable to troubleshoot code errors until the error fires again and writes to the log.

df -h
#check available disk space
find /home -name '*.php.error.log' -exec rm {} \;
#run df -h again and see how much space was freed from the home partition