Skip to content

Reading the Apache error log on cPanel: what each line tells you

The Apache error log on cPanel is the most-used troubleshooting source for web issues. Here is what to grep for and how to read the result.

Apache’s error log on cPanel is the first stop for almost every web problem and yet it is the log most operators least know how to read in detail. Lines mix together messages from the server itself, from mod_security, from PHP, from the SuExec layer, and from rotating shutdown notices. Knowing which line types are real signal and which are noise is the difference between five-minute and five-hour diagnosis.

What’s happening

The cPanel-default location for the global error log is /usr/local/apache/logs/error_log. Per-domain error logs land in /home/<user>/logs/<domain>.error.log if cPanel’s “Per-Domain Error Logs” feature is on. Each line has a timestamp, severity ([error], [warn], [notice], [info], [debug]), client IP if applicable, and the message. The message format varies wildly depending on which module emitted it.

How to verify

The common useful greps:

# real-time tail with severity filter
tail -f /usr/local/apache/logs/error_log | grep -E "\[error\]|\[warn\]"
# PHP fatals and warnings
tail -200 /usr/local/apache/logs/error_log | grep -iE "PHP Fatal|PHP Warning"
# mod_security blocks
tail -200 /usr/local/apache/logs/error_log | grep "ModSecurity"
# SuExec failures
tail -200 /usr/local/apache/logs/error_log | grep "suexec"
# per-domain log
tail -100 /home/<user>/logs/<domain>.error.log

For severity selection at the global level: grep -iv "notice\|info\|debug" cuts the noise.

The fix

  1. Recognize the noisy lines — [notice] [pid X] AH00094: Command line:, Init: SSL, AH02282: No matching protocol found, and graceful-restart messages are normal. Filter them out with grep -v.
  2. Real signal patterns — PHP Fatal error (application bug), client denied by server configuration (mod_security or directory deny), End of script output before headers (PHP crashed or returned non-HTTP), Premature end of script headers (similar), request failed: error reading the headers (client cut the connection mid-request).
  3. Match timestamps to user reports — when a user says “the site was down at 14:23”, grep error_log for 14:23 and read everything within 30 seconds either side. A 500 in the error log without a 500 in the access log is a same-second correlation problem.
  4. mod_security messages — Access denied with code 403 is intentional. The rule ID (e.g., id "942100") tells you which OWASP CRS rule fired. Look it up before whitelisting.
  5. Rotate carefully — error_log is rotated by logrotate daily by default. After a rotation, the previous file is error_log.1. If a problem started “this morning”, check both.

The per-domain logs are usually more useful than the global one because they isolate one application. Stack Harbor builds log-correlation alerts for cPanel hosts under cPanel/WHM management — start a conversation when error patterns are not obvious.