yum 安装php
编译安装nginx
启动php-cgi
./php-cgi -b 9000 -c /etc/php.ini &
vi /usr/local/nginx/conf/nginx.conf
在虚拟主机配置中添加
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
重新加载nginx /usr/local/nginx/sbin/nginx -s reload
over
本文转自 freeterman 51CTO博客,原文链接:http://blog.51cto.com/myunix/1107888,如需转载请自行联系原作者