DEV3 Technologies home

DEV3 Developer Forum

How do I diagnose a WordPress 500 Internal Server Error?

WordPress helpSolved0 views
dev3 ·

After editing .htaccess, my site returns "500 Internal Server Error" and there is no message at all. How do I find out the cause?

#wordpress#troubleshooting#php

0

1 reply

dev3 · Accepted answer

A 500 is a generic server failure. The real message is in the server error log, not in the browser.

Read the log

  • Apache: /var/log/apache2/error.log (Debian/Ubuntu) or /var/log/httpd/error_log.
  • Nginx plus PHP-FPM: /var/log/nginx/error.log and /var/log/php8.3-fpm.log.
  • Shared hosting: the error log link in cPanel or Plesk.
sudo tail -n 50 /var/log/apache2/error.log

Typical causes and fixes

  1. Bad .htaccess (your case). Rename it to .htaccess.bak; if the site returns, the file is broken. Typical errors are a directive from a missing module ("Invalid command ... perhaps misspelled or defined by a module not included") or php_value lines on a PHP-FPM server. Regenerate the default rules by saving Settings > Permalinks, or paste the standard WordPress block.
  2. Plugin or theme fatal error. Rename the plugin folder, or enable WP_DEBUG_LOG (see white screen topic).
  3. PHP version mismatch. An outdated plugin on PHP 8.x, or a new plugin needing a newer PHP.
  4. Wrong permissions. Folders 755, files 644. A directory writable by group or others can trigger errors under suexec or suPHP.
  5. Memory or execution limits exceeded.
  6. Core files corrupted: wp core download --force --skip-content replaces core without touching wp-content.

Nginx note: Nginx does not read .htaccess, so a 500 there is from the Nginx config or PHP-FPM; check nginx -t.

Always change one thing and retest. Keep a copy of the working .htaccess. You can generate a clean one with the htaccess generator.

0

Your reply

Every post is reviewed by DEV3 before it appears. Usually reviewed within 24 hours.

Markdown supported. Use ``` for code blocks. Images are not allowed.