Status codes · one code500Internal Server Error

What a 500 Internal Server Error response means, who is at fault, what a visitor should do and what the server owner should do.

Open the reference on this code
What is happening

A blank page instead of the site

PHP Fatal error: Uncaught Error: Call to a member function query() on null

The application crashed while handling a valid request. From outside every cause looks the same — a blank page or a terse «Internal Server Error» — so guessing is pointless: the real error sits in the server log, and the first step is always to read it.

Code
Who is at faultServer error
Class5xx Server error
01

What to do

If it is someone else's site

On someone else's site there is nothing to do: the error is on the server, and neither a reload nor clearing the cache will fix it. Retrying in a few minutes is reasonable, and if the site matters, tell the owner — a 500 is often seen only by whoever stumbled into it.

If it is your server

Read the application log, not just the web server's: nginx records the fact of the error while the cause comes from the language or framework. Do not turn on error display in production: it hands strangers disk paths, versions and fragments of code. If the 500 appeared after a deploy, compare with the previous release before fixing anything: it is usually the release rather than the load.

02

Easily confused with

502Bad Gateway

it is not the server that failed but the upstream behind the proxy: the application never answered at all.

502
503Service Unavailable

the server is alive and honestly says «not now»: overload or maintenance.

503
200OK

an error page served as success is the worst option: it gets indexed.

200
03

How to check

tail -n 100 /var/log/nginx/error.log

the last thing the web server wrote — usually with the time of the crash

journalctl -u php8.3-fpm -n 100 --no-pager

the application's own log: the cause is here rather than at the proxy

Find another code

The reference holds sixty-four codes searchable by number, name and meaning — plus a breakdown of confusing pairs such as 401 and 403.

Open the reference on this codeAll codes

Updated

«» added to favorites