500 Internal Server Error
Find the cause of a 500 Internal Server Error by checking logs, recent deploys, plugins, PHP failures, permissions, and rollback options.
Start here
Quick Answer
Reproduce once, capture the timestamp and URL, then check the application, PHP, web server, and deployment logs. Do not keep refreshing or changing settings before you find the first specific error.
Why 500 is a catch-all
A 500 response tells you the server hit an unexpected condition while processing the request. It does not identify the root cause by itself. Use timestamps, request IDs, and matching access/error log lines before changing code, plugins, permissions, or server settings.
Visitor vs site owner actions
A visitor can refresh, retry another network, or report the URL and timestamp. A site owner should preserve the failed response, check the access and error logs, review recent deploys or plugin updates, then roll back the smallest recent change if the logs point to it.
Common log phrases
| Log phrase | Likely meaning | Next page |
|---|---|---|
PHP Fatal error | PHP, plugin, theme, or app crash | WordPress 500 checks |
permission denied | File ownership or permission issue | Log triage guide |
prematurely closed connection | App process or upstream issue | 502 diagnosis if a proxy is involved |
Diagnosis
Symptoms
- One route, form, admin page, or full site returns 500.
- Recent code, plugin, dependency, permission, or config changes happened nearby.
- Logs mention fatal errors, exceptions, memory limits, permission denied, or database failures.
Common causes
- Application exception or PHP fatal error.
- Bad deployment, missing dependency, or incompatible runtime version.
- File permission, rewrite, or environment variable mismatch.
- Database connection, query, or migration failure.
Diagnostic Checklist
- Record URL, timestamp, user action, and request method.
- Check application and web server error logs for the same timestamp.
- Compare recent deploys, config edits, and dependency changes.
- Roll back the smallest likely change only after saving evidence.
Fixes
Find the first server-side error
- 10 minutes
- Risk: low
- Developer
- Application, server logs
Turn a generic 500 into a specific file, route, or dependency failure.
- Open application, runtime, and web server error logs.
- Search the failing timestamp and URL path.
- Copy the first exception or fatal error line.
- Map that line to the deployment, plugin, config, or dependency that owns it.
The 500 is tied to a specific failing component.
If logs are empty, verify logging configuration and reproduce once with correlation IDs if available.
Reload the URL after the targeted fix and confirm the error line stops.
Revert unrelated changes made while diagnosing.
Roll back a recent risky change
- 15 minutes
- Risk: medium
- Site owner
- Deployment, CMS, config
Reduce outage impact when the error clearly follows a recent change.
- Identify the smallest recent change linked to the failing route.
- Capture current state and logs before rollback.
- Use the normal deploy, hosting, or CMS rollback path.
- Clear only the caches touched by the change.
The failing route recovers or reveals a narrower error.
If rollback does not help, restore the captured state and continue log analysis.
Test the failing route and a known-good route.
Record the version or setting restored.
Platform notes
For WordPress, check plugins, themes, PHP errors, and database health. For nginx, a backend application 500 is different from an nginx-generated 502 upstream failure.
FAQ
Can visitors fix a 500 error?
Usually no. Visitors can retry later or report the exact URL, but the fix belongs to the site owner or server operator.
Is 500 the same as 502?
No. A 500 is an internal server or application failure. A 502 is a gateway failing to get a valid upstream response.
Review notes
- Last reviewed
- 2026-05-05
- Reviewed by
- FaultForge Editorial Team, Web operations reviewer
- Tested on
HTTP status checks, access and error log review, server response headers, recent deployment review, and safe rollback verification.