Apache pointing at the wrong PHP-FPM socket (or one that doesn’t exist) is a reliable way to get 500 or 503 errors. This guide helps you verify the wiring and fix it.
Symptoms
- 503 Service Unavailable
- 500 errors after a “successful” PHP upgrade
- Apache error log mentions proxy or FastCGI backend failures
Quick checks
- PHP-FPM running:
sudo systemctl status php*-fpm --no-pager - Socket exists and permissions look sane
- Vhost points to the intended pool and version
Fix pattern
- Align the vhost handler with the correct pool and socket
- Restart PHP-FPM first, then Apache
FAQ
How do I know which socket my vhost is using?
Search the vhost config for php-fpm, unix:, or fcgi://. The path or port should match a pool in /etc/php/*/fpm/pool.d/. After changing PHP version or pool config, this is the first place to check.
We have multiple PHP versions—could that cause this?
Yes. See PHP version drift on multi-site servers for how mixed versions creep in and how to document and align them.
Related
- Apache + PHP-FPM stability basics — baseline wiring
- WordPress 500 errors: fast triage — 500 triage flow
- PHP version drift on multi-site servers — version and pool drift