Developer Tools

HTTP 500 Internal Server Error

5xx Server Error. The server encountered an unexpected condition that prevented it from fulfilling the request.

Runs in your browser. Your files and text never leave your device - nothing is uploaded.

5xx Server Error

What it means

The server encountered an unexpected condition that prevented it from fulfilling the request.

PropertyDetail
Status class5xx Server Error
Defined inRFC 9110, Section 15.6.1
Cacheable by defaultOnly with explicit caching headers: a cache stores it when the response carries Cache-Control (max-age, s-maxage or public) or Expires.
Who needs to actThe site or API owner. Visitors can only retry or report it.

What does HTTP 500 Internal Server Error mean?

HTTP 500 Internal Server Error means the server ran into an unexpected condition that stopped it from fulfilling the request. It is a generic catch-all: the code itself does not say what broke, only that the fault lies on the server side rather than in the request. The server error log is where the real cause is recorded.

How 500 Internal Server Error works

RFC 9110 defines 500 in a single sentence, and that vagueness is the point: it is what servers send when nothing more specific applies. Most 500s are unhandled exceptions, where application code throws and the framework turns the crash into a generic error page. Configuration mistakes cause many of the rest; an invalid directive in an Apache .htaccess file, for example, makes every request under that directory fail with 500. Because 500 is not heuristically cacheable, caches keep an error response only if explicit headers allow it, so a fix takes effect for visitors as soon as it is deployed.

Example 500 request and response

POST /checkout HTTP/1.1
Host: shop.example.com
Content-Type: application/x-www-form-urlencoded

HTTP/1.1 500 Internal Server Error
Content-Type: text/html
Cache-Control: no-store

The visitor sees a generic error page. The stack trace that explains it is written to the server log, not sent in the response.

What causes a 500 Internal Server Error

  • An unhandled exception or fatal error in application code, such as a null reference or a PHP fatal error.
  • A syntax error or unsupported directive in .htaccess or another server configuration file.
  • A failed database query, a missing environment variable or an unreachable dependency that the code does not handle.
  • Permission problems on files the application needs to execute or write.
  • Exhausted resources, such as PHP's memory_limit being reached.

How to fix a 500 Internal Server Error

If you are a visitor

  • Reload once after a short wait; transient failures do clear.
  • If it persists, check the service's status page or report it with the time and the URL.
  • Do not resubmit a payment or order until you have confirmed the first attempt failed.

If you run the site

  • Read the application and web server error logs at the timestamp of the failure.
  • Reproduce the error locally with debug output enabled, never in production.
  • Roll back the latest deploy or configuration change if errors started right after it.
  • Catch expected failures, such as a missing record or invalid input, and return the right 4xx code instead.

500 and SEO

Occasional 500s do little harm, but persistent ones do. Google lowers the crawl rate for a site in proportion to the number of URLs returning server errors, keeps already indexed URLs for a while, and removes URLs that persistently return a server error. If robots.txt itself returns a 5xx, Google stops crawling the site for the first 12 hours while it keeps retrying.

Related status codes

  • 502 Bad Gateway: A proxy received a bad response from the upstream server, rather than the server failing itself.
  • 503 Service Unavailable: The server is temporarily unavailable, often on purpose, and may say when to retry.
  • 501 Not Implemented: The server does not support the requested functionality: a deliberate refusal, not a crash.

Frequently asked questions

Sources

Other 5xx Server Error codes

Reviewed by Raja Jahangir · Last reviewed: October 7, 2026