Php 获得;未指定输入文件;仅当路径信息为空时?

Php 获得;未指定输入文件;仅当路径信息为空时?,php,apache,.htaccess,fastcgi,Php,Apache,.htaccess,Fastcgi,我已经安装在一个子域(PHP FastCGI 5.4.29)中。默认安装附带以下.htaccess: <IfModule mod_rewrite.c> Options -MultiViews +SymLinksIfOwnerMatch RewriteEngine On #RewriteBase /path/to/gitlist/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ i

我已经安装在一个子域(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>
编辑:我接受了答案,因为链接指向了解决方案,但我没有使用nginx:

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

可能您需要更改一些设置

对于exmaple For 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;
    }
}
更多信息请访问。同样类似的问题(但针对不同的libraray)出现在

我没有使用ngix,但帮助我解决了这个问题。不知道为什么要添加
修复了。。。
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;
    }
}