fastcgi与nginx整合后,访问php网页出错:no input file specified
与此错误相关的位置有以下以点:
1.php.ini配置文件
cgi.fix_pathinfo=1
doc_root=
2.nginx.conf配置文件
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3.nginx配置文件,也是我自己出现的问题
我的主要配置文件如下:
server {
listen 7080;
server_name localhost;
location /store/ {
root /var/www/html/;
index index.php index.html;
}
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
要修改成如下:
server {
listen 7080;
server_name localhost;
root /var/www/html/; #把root写在server下,而不是location下
index index.html;
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
阅读(3123) | 评论(0) | 转发(0) |