nginx + spawn-fcgi

apt-get install spawn-fcgi php5-cgi

用 spawn-fcgi 启动 fcgi ,

spawn-fcgi -a 127.0.0.1 -p 8000 -u nobody -f /usr/bin/php-cgi -C 5 ;

在 nginx 里配置加一句:
location ~ .php$ {
fastcgi_pass 127.0.0.1:8000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/nginx/html$fastcgi_script_name;
include fastcgi_params;
}

发表评论