Php 没有指定输入文件

Php 没有指定输入文件,php,apache,.htaccess,mod-rewrite,anchor-cms,Php,Apache,.htaccess,Mod Rewrite,Anchor Cms,我正在运行,刚刚升级到0.8版。当我尝试运行安装程序时,会出现“未指定输入文件”错误。我相信这很可能是一个.htaccess问题,但我不确定正确的设置应该是什么 我的网站可以找到 My.htaccess设置为: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase {base} # Allow any files or directories that exist to be displayed directly Rewrite

我正在运行,刚刚升级到0.8版。当我尝试运行安装程序时,会出现“未指定输入文件”错误。我相信这很可能是一个.htaccess问题,但我不确定正确的设置应该是什么

我的网站可以找到

My.htaccess设置为:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {base}

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ {index} [L]
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>

重新启动发动机
重写基{base}
#允许直接显示现有的任何文件或目录
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
#将所有其他URL重写为index.php/URL
重写规则^(.*)${index}[L]
ErrorDocument 404 index.php
如果有帮助的话,我还使用GoDaddy作为主机提供商

指定的无输入文件是由于服务器上的PHP实现而显示的消息,在本例中表示CGI实现(可通过验证)

现在,为了正确地解释这一点,您需要对系统如何使用URL有一些基本的了解。根据.htaccess文件,CMS似乎希望URL作为
PATH\u INFO
变量传递。CGI和FastCGI实现没有可用的
PATH\u INFO
,因此当尝试传递URI时,PHP会失败并显示该消息

我们需要找到一个替代方案

一个选择是尝试解决这个问题。查看文档,您可以看到您可以更改实现的工作方式。尽管如此,GoDaddy可能不允许您在共享环境中更改PHP设置

我们需要找到修改PHP设置的替代方案
查看第40行的
system/uri.php
,您将看到CMS尝试了两种类型的uri检测——第一种是
PATH\u INFO
,我们刚刚了解到它不起作用——另一种是
REQUEST\u uri

这基本上已经足够了,但是对传递的URI的解析会给您带来更多的麻烦,因为可以传递到
REQUEST\u URI
变量的URI强制只返回URL路径,这基本上会使您返回到零

现在,实际上只剩下一种可能性——那就是改变CMS的核心。URI检测部分不足

QUERY\u STRING
作为
system/uri.php
中的第一个元素添加到第40行的数组中,并将.htaccess更改为如下所示:

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^(.*)$ index.php?/$1 [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /crm/

Options +FollowSymLinks 

RewriteCond %{HTTP_HOST} ^mywebsite.com [NC] 

RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [L,R=301] 

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L]

RewriteRule ^index.php/(.*)$ [L]
</IfModule>
这将把您请求的URI作为
QUERY\u STRING
传递到
index.php
,并通过URI检测找到它

另一方面,这使得在修复之前,在不更改核心文件的情况下更新CMS是不可能的。那太糟糕了

需要更好的选择吗?
寻找更好的CMS。

GoDaddy目前(2月13日)支持对一些使用PHP5.2.x或更早版本的帐户修改FastCGI。参见GoDaddy文章“。
(就我而言,这显然是必要的,以帮助LimeSurvey(2.0)的当前版本进入运行状态。)

引用:

如果您想将GoDaddy用作主机,并且发现自己在控制面板中出现“未指定输入文件”错误,则需要使用以下规则在weboot中创建
php5.ini
文件:

cgi.fix\u pathinfo=1

最好的简单答案只要换一行就可以了


推荐godaddy托管。

我的解决方案是删除一个助手文件中的空白。错误列出了涉及的两个页面,一个CI会话文件和一个自定义帮助程序

添加php5.ini根本不起作用。 但请参阅本文中关于GoDaddy的“禁用FastCGI”部分:

将以下行添加到.htaccess文件(webroot和网站安装目录):

它救了我一天!干杯
谢谢

在我的例子中,php.ini open_basedir变量中有一个错误

它对我有效..添加到.htaccess文件之上。它将禁用godaddy共享托管帐户上的FastCGI

选项+执行CGI


addhandler x-httpd-php5-cgi.php我也遇到了同样的问题。我所做的一切就是修改我的htacces文件,如下所示:

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^(.*)$ index.php?/$1 [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /crm/

Options +FollowSymLinks 

RewriteCond %{HTTP_HOST} ^mywebsite.com [NC] 

RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [L,R=301] 

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L]

RewriteRule ^index.php/(.*)$ [L]
</IfModule>

重新启动发动机
数据库/客户关系管理/
选项+FollowSymLinks
重写cond%{HTTP_HOST}^mywebsite.com[NC]
重写规则^(.*)$http://www.mywebsite.com/$1[L,R=301]
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
重写规则^index.php/(.*)$[L]

Run
ulimit-n2048

然后重新启动php/php fpm


更新
以前的所有评论都是我测试的,但没有解决方案。但我没有放弃

解决方案

取消注释my NGINX配置中的以下行

   [/etc/nginx/site-avaible/{sitename}.conf]
 nginx -t
站点启用文件夹中应遵循相同的代码

  #fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
并对此进行评论:

  fastcgi_param SCRIPT_FILENAME / www / {namesite} / public_html $ fastcgi_script_name;
   #fastcgi_pass unix: /var/php-nginx/9882989289032.sock;
   #fastcgi_pass 127.0.0.1:9007;
  error_log/var/log/nginx/{site}_error_log;
我更改了几次原始版本:

  fastcgi_param SCRIPT_FILENAME / www / {namesite} / public_html $ fastcgi_script_name;
   #fastcgi_pass unix: /var/php-nginx/9882989289032.sock;
   #fastcgi_pass 127.0.0.1:9007;
  error_log/var/log/nginx/{site}_error_log;
回到这里:

  fastcgi_param SCRIPT_FILENAME / www / {namesite} / public_html $ fastcgi_script_name;
   #fastcgi_pass unix: /var/php-nginx/9882989289032.sock;
   #fastcgi_pass 127.0.0.1:9007;
  error_log/var/log/nginx/{site}_error_log;
最后我找到了有效的方法…

   fastcgi_pass localhost: 8004;
   #fastcgi_index index.php;
   #include fastcgi_params;
我也推荐这些线路……

   fastcgi_pass localhost: 8004;
   #fastcgi_index index.php;
   #include fastcgi_params;
甚至FastCGI超时(只是为了提高性能)

在此过程中,我检查了NGINX日志中的所有修改。 (这非常重要,因为它显示了错误的参数。) 在我的例子中是这样的,但这取决于配置:

  fastcgi_param SCRIPT_FILENAME / www / {namesite} / public_html $ fastcgi_script_name;
   #fastcgi_pass unix: /var/php-nginx/9882989289032.sock;
   #fastcgi_pass 127.0.0.1:9007;
  error_log/var/log/nginx/{site}_error_log;
测试NGINX配置

   [/etc/nginx/site-avaible/{sitename}.conf]
 nginx -t
注意这是一个选项。。。 在同一台服务器上,在这个站点上不起作用的东西在其他服务器上也起作用。。。因此请记住,设置取决于平台。

   fastcgi_pass localhost: 8004;
   #fastcgi_index index.php;
   #include fastcgi_params;

在本例中,它是针对Joomla CMS的。

在本例中,我通过在


#你的重写规则在这里
/。
匹配任何位置

我在其中一个