Skip to content

HTTP 500 Internal Server Error on cPanel: where to look first

A 500 on cPanel is almost always a PHP-level problem visible in two specific log files. The trick is reading them in the right order.

A 500 Internal Server Error on cPanel is a polite way for the web server to say “I asked PHP what to do and PHP either died or refused to answer”. The fix path is the same nine times out of ten: read the application’s PHP error log, then read Apache’s error log, then check the system message log. The order matters because the deeper logs are noisier.

What’s happening

Apache (or LiteSpeed) receives the request, hands it to PHP-FPM or suPHP, and waits for the response. If PHP exits non-zero, hits a fatal, or exceeds max_execution_time, the response is a 500. The application’s own error_log (in the document root) usually contains the PHP traceback. Apache’s error_log contains the connector message. If both are silent, the failure happened below PHP — segfault, OOM, or a permission denial on /tmp.

How to verify

Read the logs in this order:

# the application's PHP error log (usually next to index.php)
tail -50 /home/<user>/public_html/error_log
# cPanel-level Apache error log
tail -100 /usr/local/apache/logs/error_log
# per-domain error log if separated
tail -100 /home/<user>/logs/<domain>.error.log
# system log for kernel-level events (OOM, etc.)
journalctl -k --since "1 hour ago"
# if mod_security is in play
tail -100 /usr/local/apache/logs/modsec_audit.log

For PHP-FPM specifically:

tail -100 /opt/cpanel/ea-php82/root/var/log/php-fpm/error.log

The fix

  1. PHP traceback first — if the application’s error log shows a fatal, fix the application (missing module, type error, file_not_found). Most 500s end here.
  2. Permission denial — chown -R <user>:<user> /home/<user>/public_html, and ensure /tmp is writable. PHP cannot write its session files if /tmp is full or restricted.
  3. Memory limit — if the traceback shows “Allowed memory size exhausted”, raise memory_limit in PHP via WHM > MultiPHP INI Editor for that domain. Default is 128M; raise to 256M and check the application memory pattern.
  4. PHP version mismatch — whmapi1 php_get_domain_handler domain=example.com. If the application requires PHP 8.x and the domain runs 7.4, set it via WHM > MultiPHP Manager.
  5. ModSecurity rule block — a 500 with no PHP trace and a matching entry in modsec_audit.log is a false positive. Whitelist the rule for the domain.

A 500 that disappears when you restart cpsrvd and reappears under load is usually PHP-FPM pool exhaustion. Check pm.max_children against actual traffic. Stack Harbor handles application-level 500 triage under cPanel server management — start a conversation when 500s recur.