(1)编译安装nginx
| 1 | yum |
*pcre-devel是http rewrite模块依赖的类库
*zlib-devel是http gzip模块依赖的类库
*openssl-devel是http ssl模块依赖的类库
下载编译安装ngixn:
wget http: |
(2)安装PHP/PHP-FPM
PHP-FPM是FastCGI进程管理器,是PHP的一个补丁;
http://php-fpm.org/download/
http://php.net/downloads.php
从上述的地址中分别下载PHP版和对PHP进行打PHP-FPM补丁:
| 1234 | wget http: |
*如果缺少xml2相关错误,需安装libxml2以及libxml2-devel
(3)配置PHP-FPM
默认情况下配置文件模板放在/usr/local/etc
cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
其中默认监听地址和端口为http://127.0.0.1:9000
(4)配置nginx支持PHP
location ~ /.php$ { |
关于nginx的fastcgi模块的参考:http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
(5)启动nginx和php/php-fpm
| 1 | php-fpm && |



