php 讨厌的流行“未指定输入文件”。使用 nginx_php-fastcgi

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7297421/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:25:29  来源:igfitidea点击:

pesky popular "No input file specified." with nginx_php-fastcgi

phpnginxfastcgi

提问by Logan Best

I didn't have this problem earlier until I changed the include path on my php.ini in hopes of being able to upload to a dir outside the docroot. When I encountered the "No input file specified." error I changed it back to the default php.ini and now it won't go away!

我之前没有遇到这个问题,直到我更改了 php.ini 上的包含路径,希望能够上传到 docroot 之外的目录。当我遇到“未指定输入文件”时。错误我把它改回默认的php.ini,现在它不会消失!

Any ideas on what might've happened?

关于可能发生的事情的任何想法?

回答by Brian

in file /etc/php-fpm.d/www.conf

在文件 /etc/php-fpm.d/www.conf 中

change

改变

user: nginx

用户: nginx

group:nginx

组:nginx

回答by Fresco

Edit nginx.conf

编辑 nginx.conf

http{
....
server{
....
location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  D:\WebRoot\www$fastcgi_script_name;
        include        fastcgi_params;
    }
}}

replace D:\WebRoot\www\ with the root of your webserver

将 D:\WebRoot\www\ 替换为您的网络服务器的根目录