浏览 2732 次
锁定老帖子 主题:nginx spawn-fcgi php
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2010-04-22
最后修改:2010-06-18
安装spawn-fcgi # emerge spawn-fcgi 安装nginx # USE="pcre perl ssl zlib -addition -debug fastcgi -flv -imap -pop -random-index -realip -smtp static-gzip status -sub -webdav" emerge nginx 启动端口 # /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u uu -f /usr/bin/php-cgi 修改配置 # nano -w /etc/nginx/nginx.conf {{{ server { listen 80; server_name localhost; root /var/www/localhost/htdocs; #index index.php index.html; location ~\.php$ { include fastcgi.conf; include fastcgi_params; } } }}} # nano -w /etc/nginx/fastcgi.conf {{{ fastcgi_pass 127.0.0.1:9000; set $path_info ""; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; }}} 启动 # /etc/init.d/nginx start 准备php测试文件 nano /var/www/localhost/htdocs/test.php { <?php phpinfo(); ?> }
声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |