FastCGI 是一种让交互程序与Web服务器通信的协议。FastCGI是早期通用网关接口(CGI)的增强版本。PHP-FPM 是一个简单可靠的 FastCGI 进程管理器(FastCGI Process Manager),从 PHP 5.3.3 开始就成为了 PHP 的内置管理器。
2018-10-10 09:28:57
关于FastCGI的介绍
https://zh.wikipedia.org/wiki/FastCGI
关于FPM的介绍
http://php.net/manual/zh/install.fpm.php
https://php-fpm.org/
Installation:
1,编译 PHP 时需要 --enable-fpm 配置选项来激活 FPM 支持。
2,yum install fcgi-devel fcgi
3,从https://httpd.apache.org/mod_fcgid/ 下载mod_fcgid ,并编译
4,编辑httpd.conf
4.1, LoadModule fcgid_module modules/mod_fcgid.so ,这一项必须要有
4.2, 加入配置
<IfModule fcgid_module>
AddHandler fcgid-script .php
FcgidWrapper "/usr/local/php/bin/php-cgi" .php
</IfModule>
以上设置的话,在看phpinfo时会显示Server API:CGI/FastCGI
----------------------------------------
<IfModule fcgid_module>
AddHandler fcgid-script .php
AddHandler fcgid-script .fcgi
FcgidWrapper "/usr/local/php/bin/php-cgi" .php
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
</IfModule>
以上设置的话,在看phpinfo时会显示Server API:FPM/FastCGI
上面的设置需要打开
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
并且需要2.4.9以上版本的httpd
需要提前/usr/local/php/sbin/php-fpm起动php-fpm
起动后,可以用 netstat -antp 来查看9000端口是不是已经有了