ubuntu 下nginx 快速搭建FCGI环境
时间:2015-06-28 20:37 来源:linux.it.net.cn 作者:IT
用 spawn-fcgi 启动 fcgi
apt-get install spawn-fcgi php5-cgi
spawn-fcgi -a 127.0.0.1 -p 8000 -u nobody -f /usr/bin/php-cgi -C 5 ;在 nginx 里配置加下面一句,然后把一个 php 放在 /home/nginx/html 里,就可以使用了
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;
}
(责任编辑:IT)
用 spawn-fcgi 启动 fcgi apt-get install spawn-fcgi php5-cgi spawn-fcgi -a 127.0.0.1 -p 8000 -u nobody -f /usr/bin/php-cgi -C 5 ;在 nginx 里配置加下面一句,然后把一个 php 放在 /home/nginx/html 里,就可以使用了 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; } (责任编辑:IT) |