"500 Internal Server Error" on your website: what it means and how to fix it

A 500 Internal Server Error means the code behind your site crashed before it could send a page. The server knows why. The page does not tell you. The reason is in the error log.

What to do, in order

  1. Think about what changed. A plugin update, a theme edit, a new PHP version from your host. The last change is the cause more often than not. Undo it first.
  2. Read the error log. In cPanel it is under Metrics, Errors. On other hosts look for a file called error_log in the site folder. The last few lines name the file and line that failed.
  3. Rename .htaccess. One wrong line in .htaccess gives a 500 on every page. Rename it to .htaccess-old and reload. On WordPress, save Settings, Permalinks afterwards to write a clean one.
  4. On WordPress, switch off plugins. Rename wp-content/plugins to plugins-off. If the site returns, rename it back and turn plugins on one at a time.
  5. Check the PHP version. Old plugins break on PHP 8. Your host's control panel lets you pick the version. Step back one version to test, then update the plugin.
  6. Raise the memory limit. If the log says Allowed memory size exhausted, add define('WP_MEMORY_LIMIT','256M'); to wp-config.php.

Check it yourself

Run curl -sI https://yourdomain.com. If the first line says 500, the problem is on your server. If you see 502 or 504 instead, the server behind your host's proxy is down or too slow, which is a different fix.


Want the rest of your site checked after it is back? Run a free 40-point check at tinkeraudit.com.