【问题标题】:Getting "No input file specified." only when PATH_INFO is empty?获取“未指定输入文件”。仅当 PATH_INFO 为空时?
【发布时间】:2014-09-11 00:27:47
【问题描述】:

我在子域中安装了GitList (PHP FastCGI 5.4.29)。默认安装自带以下.htaccess

<IfModule mod_rewrite.c>
    Options -MultiViews +SymLinksIfOwnerMatch

    RewriteEngine On
    #RewriteBase /path/to/gitlist/

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [L,NC]
</IfModule>
<Files config.ini>
    order allow,deny
    deny from all
</Files>

当我尝试访问 http:/subdomain.company.com 时,出现以下错误:

没有指定输入文件。

我猜PATH_INFO 为空时会出现错误,但我不知道如何修复它。如果我访问http:/subdomain.company.com/index.php,应用程序就可以正常工作。

这是目录结构,如果有帮助的话:

-rw-r--r--  1 iosystit psacln   435 Jun 30 05:07 boot.php
drwxrwxrwx  3 iosystit psacln  4096 Jul 20 04:09 cache
-rw-r--r--  1 iosystit psacln   831 Jul 20 11:14 config.ini
-rw-r--r--  1 iosystit psacln   975 Jun 30 05:07 config.ini-example
-rw-r--r--  1 iosystit psacln   291 Jun 30 05:07 .htaccess
-rw-r--r--  1 iosystit psacln   690 Jun 30 05:07 index.php
-rw-r--r--  1 iosystit psacln  2505 Jun 30 05:07 INSTALL.md
-rw-r--r--  1 iosystit psacln  1477 Jun 30 05:07 LICENSE.txt
-rw-r--r--  1 iosystit psacln  5358 Jun 30 05:07 README.md
drwxr-xr-x  3 iosystit psacln  4096 Jun 30 05:07 src
drwxr-xr-x  4 iosystit psacln  4096 Jun 30 05:07 themes
drwxr-xr-x 16 iosystit psacln  4096 Jul 20 04:05 vendor

编辑:我接受了答案,因为链接 No input file specified 指向我的解决方案,但我没有使用 nginx:

RewriteRule ^(.*)$ index.php?/$1 [L,NC]

【问题讨论】:

    标签: php apache .htaccess fastcgi


    【解决方案1】:

    您可能需要更改一些设置。

    以 nginx 为例,有一个提示可以进行更改:

    server {
        location = / {
            try_files @site @site;
        }
    
        location / {
            try_files $uri $uri/ @site;
        }
    
        location ~ \.php$ {
            return 404;
        }
    
        location @site {
            fastcgi_pass   unix:/var/run/php-fpm/www.sock;
            include fastcgi_params;
            fastcgi_param  SCRIPT_FILENAME $document_root/index.php;
        }
    }
    

    更多信息请访问GithubNo input file specified

    也有类似的问题(但针对不同的库)

    【讨论】:

    猜你喜欢
    • 2011-07-10
    • 2019-02-08
    • 1970-01-01
    • 1970-01-01
    • 2013-01-11
    • 2017-07-24
    • 2014-12-12
    • 1970-01-01
    相关资源
    最近更新 更多