What PHP-FPM Does
PHP-FPM is the service that executes PHP code for websites such as WordPress. Nginx can receive web requests, but it does not run PHP application logic by itself.
Where PHP-FPM Sits In The Stack
PHP-FPM sits behind Nginx and in front of the WordPress application code. When Nginx receives a PHP request, it passes the request to PHP-FPM through a socket or port.
How It Works
PHP-FPM maintains worker processes. Each worker can handle a PHP request. For WordPress, that means loading WordPress core, theme files, plugins, user settings and database queries before returning the final HTML to Nginx.
Why It Breaks
PHP-FPM can break when the service stops, the socket path does not match Nginx, the worker limit is too low, memory is exhausted, plugins are too heavy or database queries are too slow.
Infrastructure Layer
Application Runtime
Difficulty Level
Beginner
Core Concept
PHP-FPM executes PHP application code for WordPress and returns the generated result back to Nginx.
System Role
It is the runtime layer that turns WordPress PHP files, plugin logic and database queries into final HTML pages.
How It Works
Nginx receives a PHP request, forwards it to the PHP-FPM socket or port, PHP-FPM runs WordPress, WordPress queries MySQL and PHP-FPM returns the response to Nginx.
Connected Components
Nginx, PHP-FPM pool, PHP version, WordPress core, plugins, themes, MySQL, server memory, error logs.
Common Failure Points
Stopped PHP-FPM service, wrong socket path, too many workers, too few workers, high memory usage, slow plugins, long database queries, 502 errors.
Verification Method
Check PHP-FPM service status, compare socket path with Nginx config, inspect PHP-FPM logs, test page response and monitor memory usage.
Basic Commands
systemctl status php8.3-fpm;
grep -R "fastcgi_pass" /etc/nginx/sites-enabled/;
tail -n 50 /var/log/php8.3-fpm.log;
free -m;
curl -I https://example.com