前提:
都已经yum install 了php nginx spawn-fcgi
第一种配置:
/etc/sysconfig/spawn-fcgi
FASTCGI_USER=nginx FASTCGI_GROUP=nginx SOCKET=/var/run/spawn-fcgi.sock PIDFILE=/var/run/spawn-fcgi.pid PHP5_SOCKET=/var/run/php-fcgi.sock CHILDREN=6 PHP5=/usr/bin/php-cgi MODE=0600 OPTIONS="-s $PHP5_SOCKET -S -M $MODE -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5"
chkconfig spawn-fcgi on service spawn-fcgi startnginx中的php配置
location ~ \.php$ { root html; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php-fcgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; }第二种:
vi /etc/rc.local /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pidnginx配置
location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php-fcgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; }
一个是fastcgi_pass unix:/var/run/php-fcgi.sock;
一个是fastcgi_pass 127.0.0.1:9000;
求给俺科普一下吧。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。