NGINX-未指定输入文件. -PHP的快速/CGI的 [英] NGINX - No input file specified. - php Fast/CGI

查看:122
本文介绍了NGINX-未指定输入文件. -PHP的快速/CGI的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为Nginx设置配置的帮助.我是NGINX的新手,并且遇到了一些问题.

Hi I need help in setting config for nginx. I am new to NGINX and facing some issues.

在我的sites-available中有一个default文件

它包含下面的代码

server {
    server_name www.test.com test.com;
    access_log /sites/test/logs/access.log;
    error_log /sites/test/logs/error.log;
    root /sites/test;

 location ~ / {

index index.php
    include /etc/nginx/fastcgi_params;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

当我编写URL时,以上代码可以完美地工作

Above code works perfectly when I write URL

www.test.com/service/public/

我写的时候

www.test.com/service/public/testservice(testservice是公共文件夹),它显示No input file specified.

www.test.com/service/public/testservice (testservice is folder within public) it says No input file specified.

如何修复它. 预先感谢.

How to fix it. thanks in advance.

我在下面尝试过,但是没有运气

I tried below, but no luck

http://nginxlibrary.com/resolving-no-input-file-specified-error/
http://blog.martinfjordvald.com/2011/01/no-input-file-specified-with-php-and-nginx/

推荐答案

您必须在

location ~ \.$php{
  #......
  include fastcgi.conf;
}

这篇关于NGINX-未指定输入文件. -PHP的快速/CGI的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆