Jerry
Jerry

Reputation: 89

What is the relationship between php-cgi and php-fpm?

When we use nginx as webserver, we also use php-fpm. If we use apache or lighttpd, we talk more about php-cgi.

So, what is the relationship and difference between php-cgi and php-fpm?

Upvotes: 4

Views: 1319

Answers (1)

Amadan
Amadan

Reputation: 198526

PHP-CGI is a CGI interface. PHP-FPM is a FastCGI interface.

CGI gets run once per request. FastCGI gets run once, at server startup, then enters a request loop. This makes CGI simpler, as it has no dependencies; FastCGI is faster, since it avoids any start-up times, but it's a bit more complex to set up.

Upvotes: 6

Related Questions