Originally published: 2016-10-03
Technical update: 22 October 2026. Disabling error logs to solve a full disk can remove the evidence needed to diagnose failures or security incidents. The archived advice to comment out ErrorLog has been removed; that is not a reliable method of disabling Apache logging either.
Apache access logs, Apache error logs, PHP error logs and application logs serve different purposes. Do not assume that every failed HTTP request is written to the same error file. Identify the active configuration and path, then investigate repeated software errors or unwanted traffic. The Apache logging guide distinguishes access and error records.
Rotate logs by time or size and define retention and access permissions. Deleting a file while a service is still writing to it may not reclaim space as expected. Preserve required incident evidence first and verify the logging mechanism used on your server.
On cPanel/WHM systems, use the Apache configuration and Log Rotation interfaces supported by your version instead of directly editing generated httpd.conf files. Menus and paths can vary. The cPanel Apache Configuration documentation lists the supported interfaces.
In production, display_errors can remain off while log_errors remains on for diagnosis. Check the effective configuration used by the web runtime: CLI and web/FPM may use different settings. The PHP error-configuration reference defines these settings separately.
Fix repeated errors and establish retention first. If normal workloads exceed capacity, assess resources for a cloud server or dedicated server. Keep passwords, access keys and unnecessary personal data out of logs. For archives and recovery, confirm the scope and retention of backup solutions separately.