HTTP 500 Internal Server Error
HTTP 500 Internal Server Error is a generic server-side failure: something went wrong in the application or server, and nothing more specific applies.
Quick answer
HTTP 500 Internal Server Error is a generic server-side failure: something went wrong in the application or server, and nothing more specific applies. Common causes are uncaught exceptions, bad configuration, database errors and broken deployments. The server logs hold the real error.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 500 Internal Server Error mean?
A 500 means the bug is on the server, not in the request. On WordPress it often comes from a plugin or a broken .htaccess; on Node, Python or PHP apps it usually comes from an unhandled exception.
| Status code | 500 |
|---|---|
| Name | Internal Server Error |
| Class | 5xx Server Error |
| Defined in | RFC 9110 §15.6.1 |
| Cacheable by default | No, unless Cache-Control says so |
| Safe to retry automatically? | Yes, with backoff |
What causes HTTP 500?
- Unhandled exceptions in application code.
- Misconfiguration (.htaccess syntax error, missing environment variables).
- Database connection or query failures.
- Exhausted memory or file permissions.
How do I fix HTTP 500?
- Read the server and application logs for the stack trace.
- Roll back the last deployment if errors started after it.
- Add error handling and monitoring (Sentry or similar) so you see failures before users report them.
- On WordPress, disable plugins and regenerate .htaccess.
What should a client do after HTTP 500?
Retry a few times with exponential backoff for idempotent requests; report persistent errors.
Does HTTP 500 affect SEO?
Short-lived 500s are fine. Persistent 5xx errors make Google crawl less and eventually drop the affected URLs from the index.
Example 500 response
HTTP/1.1 500 Internal Server Error
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json
{"error":{"status":500,"message":"Internal Server Error"}} How to return 500 Internal Server Error in code
Express (Node.js)
res.status(500).json({ error: 'Internal Server Error' }); Next.js route handler
return Response.json({ error: 'Internal Server Error' }, { status: 500 }); FastAPI (Python)
raise HTTPException(status_code=500, detail="Internal Server Error") PHP
http_response_code(500); Nginx
location = /example {
return 500;
} Other 5xx status codes
The server failed to fulfil a valid request. Retrying later, with backoff, is usually reasonable.
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 507 Insufficient Storage
- 508 Loop Detected
- 511 Network Authentication Required
- 520 Web Server Returned an Unknown Error
- 521 Web Server Is Down
- 522 Connection Timed Out
- 523 Origin Is Unreachable
- 524 A Timeout Occurred
- 525 SSL Handshake Failed
- 526 Invalid SSL Certificate
Frequently asked questions
How do I find the cause of a 500 error?
Do 500 errors hurt rankings?
Is 500 a client or server error?
Related
- 502 Bad Gateway HTTP 502 Bad Gateway means a server acting as a gateway or proxy (Nginx, a load balancer, Cloudflare) got an i.
- 503 Service Unavailable HTTP 503 Service Unavailable means the server is temporarily unable to handle the request, because it is overl.
- 504 Gateway Timeout HTTP 504 Gateway Timeout means a gateway or proxy did not get a response from the upstream server in time.
- 501 Not Implemented HTTP 501 Not Implemented means the server does not support the functionality needed to fulfil the request, mos.
- Open the HTTP Status Codes Reference → Free, no signup.