配置https 的时候 nginx +php 遇到关于No input file specified.

来源:互联网 发布:联通大数据平台 编辑:程序博客网 时间:2024/06/06 03:31

网上的各种解决方法无效,直到看到 https://m.aliyun.com/yunqi/articles/34240 

No input file specified. 相当于404 就是说没有找到php路径

不是配置好路径了吗,

后来突然明白, location / {这只是静态资源的目录, 而 location ~ \.php 才是php脚本目录 

其实英文好点不至于没搞明白~~~


 location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            index  index.html index.htm index.php;

            root   G:/WWW/xxx; #站点目录

            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;

}


忘记在fastcgi配置上加 root目录 以致运行PHP就提示 No input file specified.   但是静态文件却没问题;

问题解决  这是其中一种问题,百度问题的时候 关键还是要看问题源头,不要着急找答案


阅读全文
0 0