More fixes

WordPress site shows "500 Internal Server Error"

You may see "Internal Server Error: The server encountered an internal error or misconfiguration and was unable to complete your request", or in Chrome "This page isn't working ... HTTP ERROR 500". Either way the web server started on the page and gave up, and the screen does not say why. The reason is written down in one place, the server's error log, and on a WordPress site it is nearly always one of five things: a bad line in .htaccess, a plugin or theme that crashes, a PHP version change, wrong file permissions, or a typo in wp-config.php. Below is a rebuilt example (not a real client), then how to find which one it is and fix it without making things worse.

What a visitor sees on every page

lakesideautorepair.example

What the checks found


  

Find out which kind it is (five minutes)

  1. Read the error log first. In the host's control panel: cPanel has Metrics, Errors; other hosts have "Logs" or "Error log" under the site. A file named error_log may also sit in the site's main folder or in wp-admin. The newest line at the time you loaded the page usually names the cause outright: a file and line number, "Invalid command", "Permission denied", or "PHP Fatal error".
  2. Note what changed just before. A plugin or theme update, a line pasted from a tutorial, a host "upgrade" email about PHP, a site move, a security plugin's "harden" button. The last change is the first suspect.
  3. Is it every page, or only some? Every page including /wp-admin points at .htaccess, wp-config.php or the PHP version. Only the front of the site, or only one form or button, points at a plugin or the theme.
  4. Is it really 500? 502, 503 and 504 are different: the server was too busy or too slow to answer, which is a hosting capacity question, not a broken file. A white page with no words is the white screen, and "There has been a critical error on this website" is its own guide.

The fixes, in the order to try them

  1. Back up first. Take a backup in the host's panel, or at least download .htaccess and wp-config.php before touching them. Every step below is a rename or a small edit you can undo.
  2. Test .htaccess. In the file manager (turn on "show hidden files"), rename .htaccess in the site's main folder to .htaccess-old and reload the home page. If the home page comes back, the file was the cause. Log in, go to Settings, Permalinks and click Save without changing anything: WordPress writes a fresh, correct file. Then look in the old file for what was added; lines starting php_value or php_flag are the usual culprit, because many servers do not allow them there. If inner pages now 404, see the pages 404 guide.
  3. Test the plugins. Rename wp-content/plugins to plugins-off. If the site loads, rename it back, then switch plugins on one at a time (or rename single plugin folders) until the error returns; the plugin conflict guide has the method. Renaming keeps every plugin's settings.
  4. Test the theme. Rename the active theme's folder in wp-content/themes; WordPress falls back to a default theme such as Twenty Twenty-Four if one is installed. Site loads: the theme needs an update or its last edit undone.
  5. Check the PHP version. In the host panel ("Select PHP Version" or "PHP settings"), see if it changed recently. An old theme or plugin may crash on PHP 8. Go back one version to get the site up today, then update or replace what crashed, because old PHP versions stop getting security fixes.
  6. Check permissions if the log says "Permission denied" or the site was just moved. Folders should be 755 and files 644, with wp-config.php 640 or 600 if the host recommends it. Many hosts refuse to run files set to 777 and answer with a 500.
  7. Check wp-config.php if it was edited: a missing semicolon or quote there breaks every page. Compare with the copy you downloaded, or with wp-config-sample.php for the shape of each line.
  8. Still broken with all of that ruled out? Re-upload fresh wp-admin and wp-includes folders from the same WordPress version (this does not touch wp-content, so posts, photos and settings stay), or send the host the exact log line and the time: some causes, like a server module or a memory cap on the plan, only the host can change.
  9. Test: the home page, two inner pages, the contact form and the dashboard, logged out and on your phone. Check the error log again the next day.

What the log says, what it means, what it needs

What you findWhat it meansUsual fix
"Invalid command 'php_value'" or "php_flag" in the logA line in .htaccess this server does not allowRemove the line; set the value in the host's PHP settings instead
Site back after renaming .htaccessA broken or foreign rule in that fileSettings, Permalinks, Save to write a clean one
"PHP Fatal error" with a path in wp-content/plugins/nameThat plugin crashedUpdate it, or switch it off and replace it
Started after the host changed PHPOld code that does not run on the new versionOne version back for today, then update the plugin or theme
"Permission denied", or right after a site moveFiles the server will not read or runFolders 755, files 644, nothing at 777
"syntax error" in wp-config.phpA typo in the last editRestore the downloaded copy, redo the edit carefully
"Allowed memory size ... exhausted"The page ran out of memorySee the memory guide

What not to do

Most 500 errors are one of steps 2 to 4 and the site is back in fifteen minutes. If the log says something you cannot place, or the host is pointing at your site while you are pointing at the host, that is what the box below is for. Related: "redirected you too many times" and "the link you followed has expired", whose upload-size fix is where many of these php_value lines come from.