500 Internal Server Error

Also searched as: 500 error

Updated 11 October 2026

Short answer

A 500 error means your server received the request, tried to run your site's code, and something failed that the code didn't handle. The page itself doesn't say what. The answer is in the server's error log, which records the exact error and the line of code where it happened. Start there, and look at what changed just before it began.

What's the problem

Visitors see "500 Internal Server Error", "HTTP ERROR 500", or a generic "something went wrong" page. It might be the whole site, or just one page, form or checkout step.

Why it happens

"500" is a catch-all. The common causes:

  • A bug in the code, often from a recent deploy or update.
  • A broken configuration file, such as a typo in .htaccess, nginx.conf or an environment setting.
  • A plugin or theme failing, especially after an update (common on WordPress).
  • The database can't be reached, and the code doesn't handle that gracefully.
  • Missing environment variables or secrets, such as an API key that wasn't set on the live server.
  • Wrong file permissions after files were uploaded or moved.
  • The server ran out of memory part-way through a request.

How to fix it

  1. Note when it started and what changed just before: a deploy, a plugin update, a config edit. That's the most likely cause.
  2. Open the error log. On most hosts it's in the control panel under "Logs" or "Error log". On a VPS it's usually under /var/log/. On platforms like Vercel or Heroku, use their logs view. Look for entries at the time the 500 happened.
  3. Undo the last change if you can: roll back the deploy, disable the plugin, restore the previous config.
  4. Check environment variables on the live server match what the code expects.
  5. Check the database is up and the connection details are right.
  6. If it's one page only, the bug is in the code for that page. The log line will name the file.

What Preventionlabs checks

One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go; up to 50 pages from your sitemap, listing any that fail or are slow, plus broken links on them. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when; which requests the firewall blocked, by Cloudflare's own rule names; recent deploys and account changes, with their times.

Run your free report

Your first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.

Sources

  1. MDN Web Docs: 500 Internal Server ErrorreferenceThe HTTP 500 Internal Server Error server error response status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
← All of Error codes