boy11-2 发表于 2011-01-05 17:12

ubuntu 下nginx 快速搭建FCGI环境

[代码] 用 spawn-fcgi 启动 fcgi

1 apt-get install spawn-fcgi php5-cgi

2   

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

[代码] 在 nginx 里配置加下面一句,然后把一个 php 放在 /home/nginx/html 里,就可以使用了

1 location ~ .php$ {

2   fastcgi_pass 127.0.0.1:8000;

3   fastcgi_index index.php;

4   fastcgi_param SCRIPT_FILENAME /home/nginx/html$fastcgi_script_name;

5   include fastcgi_params;

6 }
页: [1]
查看完整版本: ubuntu 下nginx 快速搭建FCGI环境