Skip to content

WordPress 500 Internal Server Error: the full diagnostic chain

A WordPress 500 can come from PHP, the web server, a plugin fatal, or a filesystem permission. Here is the order to diagnose a WordPress 500, layer by layer.

A 500 Internal Server Error is the most generic failure WordPress can throw — and that’s exactly why it’s hard. It means “something broke and the layer that returned the response refused to be specific”. The diagnostic isn’t a single check, it’s a structured walk through five candidate layers in a fixed order.

What’s happening

The 500 is returned by whichever component first decided the response was unrecoverable. PHP-FPM returns 500 when a worker dies mid-request (memory exhausted, segfault, child killed by the OS). The web server returns 500 when it can’t talk to the FPM socket or when an .htaccess directive is malformed. WordPress can render its own 500 from wp_die() after catching a fatal — but only since PHP 7’s fatal error handler made that possible. Most often what users see as a “WordPress 500” is actually PHP-FPM returning to Nginx or Apache because a worker died.

The five usual suspects: a plugin fatal (most common), PHP memory exhausted, a malformed .htaccess rule, an open_basedir violation, or filesystem permissions wrong on wp-content.

How to verify

Capture timestamps and walk the layers:

tail -f /var/log/nginx/error.log /var/log/php8.2-fpm.log wp-content/debug.log
curl -I https://example.com/
curl -v https://example.com/ 2>&1 | grep -E "HTTP|X-"
wp plugin list --status=active --field=name
wp eval 'echo ini_get("memory_limit"), "\n";'
ls -la wp-content/ wp-content/plugins/ wp-content/uploads/

If wp runs but the public site returns 500, the issue is in the web layer (PHP-FPM socket, .htaccess, permissions). If wp fails too with a fatal trace, it’s a plugin or theme.

The fix

  1. Read the PHP-FPM log first. A line like WARNING: [pool www] child 1234 exited on signal 9 (SIGKILL) means the OOM killer hit the worker — raise memory_limit or find the leak. A segfault means a PHP extension is broken.
  2. Read the WordPress fatal entry. In debug.log or PHP’s error_log, a fatal will include the file and line. Find the responsible plugin from the path.
  3. Disable plugins via WP-CLI. wp plugin deactivate --all is the fastest bisect. If the 500 clears, reactivate one at a time. If WP-CLI can’t reach the database, the issue is upstream of plugins.
  4. Check .htaccess. Rename it temporarily; if the site recovers, the file had a malformed rule. Common culprits: RewriteRule syntax errors, missing IfModule wrappers, security plugin additions.
  5. Verify permissions. wp-content/ should be 755, files 644, owned by the user the FPM pool runs as. If a backup tool ran as root and left files owned by root, FPM gets Permission denied and returns 500.
  6. Raise memory_limit if needed. Set WP_MEMORY_LIMIT in wp-config.php and memory_limit in php.ini to at least 256M for an active site. 128M is no longer enough for most plugins.

For sites where 500 errors recur and you need a permanent monitor on the four logs simultaneously, Stack Harbor delivers that as part of enterprise WordPress operations. For triage on a current 500, book a consult.