您的位置:首页 > 运维架构 > Nginx

windows 下安装nginx + php (cgi)的一些问题

2016-05-27 22:21 543 查看

问题1:安装完php后,php-cgi运行不起来

运行命令php-cgi -b 127.0.0.1:9006 -c php.ini

程序很快就退出了,再去官网查看一下下载的版本对不对,结果发现是自己没装VC14的运行库

问题2:nginx.conf php.ini的配置问题

php.ini

cgi.fix_pathinfo=1

nginx.conf

upstream multicgi {
server 127.0.0.1:9006;
server 127.0.0.1:9007;
}

server {
listen       80;
server_name  localhost;
location ~ \.php$ {
root           D:/xxxx/xxxx;
fastcgi_pass   multicgi;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
include        fastcgi_params;
}


问题3:访问http://localhost/index.php 并没有展示hello word,而是直接把文件下载下来了

浏览器缓存问题,清一下浏览器缓存
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  php windows nginx cgi