当前位置:Gxlcms > 数据库问题 > windows下搭建nginx+php+mysql环境

windows下搭建nginx+php+mysql环境

时间:2021-07-01 10:21:17 帮助过:52人阅读

  cgi.force_redirect = 0 

  cgi.fix_pathinfo=1

  fastcgi.impersonate = 1

  cgi.rfc2616_headers = 1

  extension_dir = "./ext"(写绝对路径也行) 

2.配置nginx(主要是配置它支持php)注意这里面的$document_root变量,它对应的内容就是root参数值,如果我们没有定义root参数或者把root注释掉,在访问php的时候,

 

 

页面上就会出现No input file specified.提示。

 

location ~ \.php$ {
            root           F:/wnmp/nginx-1.10.2/html; #这是目录路径(默认是写nginx的html目录,访问时出现"Welcome to nginx")
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;#
            include        fastcgi_params;
        }

(1).注意这里的$document_root是root参数值也就是上面的路径,如果没有定义,或者注释了,访问php时,页面回提示No input file specified

location / {
            root   F:/wnmp/nginx-1.10.2/html;
            index  index.html index.htm index.php;#这里加入index.php是为了nginx能识别php脚本
        }


windows下搭建nginx+php+mysql环境

标签:.com   nginx   没有   nmp   ams   行修改   php脚本   ble   php   

人气教程排行