Using NGINX with PHP-FPM
Apache has long been considered the only option for serving the PHP websites because the mod_php
Apache module makes integrating PHP directly into the web server an easy task. With
PHP-FPM being accepted into PHP's core, there is now an alternative bundled with the PHP distribution. PHP-FPM is a way of running PHP under a FastCGI server. The PHP-FPM master process takes care of spawning workers, adapting to site usage, and restarting sub-processes when necessary. It communicates with other services using the FastCGI protocol. You can learn more about PHP-FPM itself at http://php.net/manual/en/install.fpm.php.
NGINX has a fastcgi
module, which is capable of communicating not only with PHP-FPM, but also with any FastCGI-compliant server. It is enabled by default, so no special consideration needs to be made to start using NGINX with FastCGI servers. The following table lists the FastCGI directives:
FastCGI Directive |
Explanation |
---|---|
|
This directive... |