简体   繁体   English

php-cgi和php-fpm之间有什么关系?

[英]What relationship between php-cgi and php-fpm?

When we use nginx as webserver, we also use php-fpm. 当我们使用nginx作为webserver时,我们也使用php-fpm。 If we use apache or lighttpd, we talk php-cgi more. 如果我们使用apache或lighttpd,我们会更多地讨论php-cgi。 So the question is what relationship and difference between php-cgi and php-fpm? 那么问题是php-cgi和php-fpm之间的关系和区别是什么? Thanks very much. 非常感谢。

PHP-CGI is a CGI interface. PHP-CGI是一个CGI接口。 PHP-FPM is a FastCGI interface. PHP-FPM是一个FastCGI接口。

CGI gets run once per request. CGI每个请求运行一次。 FastCGI gets run once, at server startup, then enters a request loop. FastCGI在服务器启动时运行一次,然后进入请求循环。 This makes CGI simpler, as it has no dependencies; 这使得CGI更简单,因为它没有依赖性; FastCGI is faster, since it avoids any start-up times, but it's a bit more complex to set up. FastCGI速度更快,因为它可以避免任何启动时间,但设置起来要复杂一些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM