Skip to content

Reading WordPress error logs: Apache, Nginx, PHP-FPM, and debug.log

A WordPress incident touches four separate logs. This walks through where each WordPress log lives, what shape its lines take, and the order you read them in during a real outage.

When a WordPress site breaks, junior operators look at debug.log first and stop. That misses the layer the user actually hit. A WordPress incident touches four logs — the web server’s access and error logs, the PHP-FPM pool log, and WordPress’s own debug.log — and the trick is reading them in the right order.

What’s happening

A request enters at the web server. Apache or Nginx writes an access log line for it and, if anything went wrong at the proxy or TLS layer, an error log line. The web server hands the request to PHP-FPM, which writes its own log when a worker crashes, exceeds memory, or hits a timeout. PHP executes WordPress, and if WP_DEBUG is on, any PHP notice or warning lands in debug.log (or wherever you pointed WP_DEBUG_LOG). A single failed request can leave a line in any combination of those four files — or, frustratingly, in none of them.

How to verify

Tail all four in parallel and trigger the failing request:

# Apache
tail -f /var/log/apache2/error.log /var/log/apache2/access.log
# Nginx
tail -f /var/log/nginx/error.log /var/log/nginx/access.log
# PHP-FPM (path varies by pool)
tail -f /var/log/php8.2-fpm.log /var/log/php-fpm/www-error.log
# WordPress
tail -f /var/www/example.com/wp-content/debug.log

Use multitail or lnav if your terminal supports it — both colour-code by file. Capture the request’s timestamp in UTC before you reproduce, then grep each log for that timestamp ±2 seconds.

The fix

  1. Start at the access log. Confirm the request actually reached the server. If there’s no entry, the problem is DNS, CDN, or the firewall — not WordPress.
  2. Check the web server error log next. Upstream timeouts (upstream timed out), connection refused, and TLS handshake failures all live here. None of them will show up in PHP or WordPress logs.
  3. Then PHP-FPM. Look for WARNING: [pool www] child ... exited on signal 9 (SIGKILL) (OOM kill), Process Manager saturation messages, or slow-log entries if request_slowlog_timeout is set.
  4. Finally debug.log. This is where PHP notices, warnings, deprecated calls, and wp_die() traces live. It’s the most detailed but also the most filtered — a 500 from a worker crash never reaches it.
  5. Correlate by timestamp. A real diagnosis lines up the same request across all four logs. If they disagree, you’ve found the layer that swallowed the error.
  6. Set up logrotate for debug.log — it has no built-in rotation and will grow until it fills the disk.

For environments where logs across multiple servers need to be correlated centrally, Stack Harbor ships log aggregation as part of enterprise WordPress support. For help triaging a current incident, book a consult.