Captcha doesn't show

We have an issue where the captcha image request just returns a 500 error.
How can I debug this?
Is there a specific server requirement for this request to work properly?

There’s no sign of error in the log, that I found.