“FastCGI,PHP-CGI and PHP-FPM”的版本间的差异
(创建页面,内容为“CGI: Common Gateway Interface 通用网管协议 FastCGI: 一种CGI的实现方式 快 php-fpm: php FastCGI Process Manager(FastCGI进程管理器) CGI CGI, Common…”) |
|||
第2行: | 第2行: | ||
FastCGI: 一种CGI的实现方式 快 | FastCGI: 一种CGI的实现方式 快 | ||
php-fpm: php FastCGI Process Manager(FastCGI进程管理器) | php-fpm: php FastCGI Process Manager(FastCGI进程管理器) | ||
+ | |||
+ | |||
CGI | CGI | ||
第8行: | 第10行: | ||
FastCGI | FastCGI | ||
FastCGI is a kind of CGI which is long-live, which will always be running. With FastCGI, it'll take less time t fork(which is a problem of fork-and-execute mode in CGI). In additional, FastCGI also supports for distributed computing. | FastCGI is a kind of CGI which is long-live, which will always be running. With FastCGI, it'll take less time t fork(which is a problem of fork-and-execute mode in CGI). In additional, FastCGI also supports for distributed computing. | ||
+ | |||
+ | |||
PHP-CGI | PHP-CGI | ||
第17行: | 第21行: | ||
After changing php.ini, you should reboot PHP-CGI to make the new php.ini work. | After changing php.ini, you should reboot PHP-CGI to make the new php.ini work. | ||
When a PHP-CGI process is killed, all the PHP code will cannot run.(PHP-FPM and Spawn-FCGI do not have the same problem) | When a PHP-CGI process is killed, all the PHP code will cannot run.(PHP-FPM and Spawn-FCGI do not have the same problem) | ||
+ | |||
PHP-FPM | PHP-FPM | ||
第25行: | 第30行: | ||
=see also= | =see also= | ||
[https://segmentfault.com/q/1010000000256516 搞不清FastCgi与PHP-fpm之间是个什么样的关系] | [https://segmentfault.com/q/1010000000256516 搞不清FastCgi与PHP-fpm之间是个什么样的关系] | ||
+ | |||
+ | [[category:php]] [[ category:ops ]] |
2021年9月12日 (日) 14:41的最新版本
CGI: Common Gateway Interface 通用网管协议 FastCGI: 一种CGI的实现方式 快 php-fpm: php FastCGI Process Manager(FastCGI进程管理器)
CGI CGI, Common Gateway Interface, is a tool for HTTP server to contact with programs on other servers, which can be used into any languages with standard input, standard output and environmental variables, such as PHP, Perl, or Tcl.
FastCGI FastCGI is a kind of CGI which is long-live, which will always be running. With FastCGI, it'll take less time t fork(which is a problem of fork-and-execute mode in CGI). In additional, FastCGI also supports for distributed computing.
PHP-CGI PHP-CGI is one kind of the Process Manager of FastCGI, which is within php itself. The command to boot is as follow: php-cgi -b 127.0.0.1:9000 shortcuts
After changing php.ini, you should reboot PHP-CGI to make the new php.ini work. When a PHP-CGI process is killed, all the PHP code will cannot run.(PHP-FPM and Spawn-FCGI do not have the same problem)
PHP-FPM
PHP-FPM is another kind of the Process Manager of FastCGI, which can be downloaded here.
It's actually a patch for PHP, which is used to integrate the Process Manager of FastCGI into PHP, which should be make into PHP before version 5.3.2.
PHP-FPM can be used to control sub processes of PHP-CGI: