【问题标题】:No input file specified error. Codeigniter 3 and go daddy subdomain没有输入文件指定错误。 Codeigniter 3 和 go daddy 子域
【发布时间】:2016-03-08 12:48:13
【问题描述】:

打开 codeigniter 基本网址后出现以下错误: “未指定输入文件”。我知道它与 htaccess 文件有关,但无法使其工作。

我的 htaccess 文件内容:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Go daddy 目录结构:htaccess 文件在子域的根目录下。

【问题讨论】:

    标签: .htaccess codeigniter


    【解决方案1】:

    您的 htaccess 文件很好,您需要检查控制器中的路径 我猜可能是视图文件丢失了

    $this->load->view('file_view', $data);
    

    在views文件夹中它被命名为“file_view.php”

    还要确保文件路径正确 如果你调用的是modules文件夹下存在module文件

    在 config 文件夹下的 routs.php 中检查 $route['default_controller'] = "frontpage";,上面的行 frontpage.php 必须存在于 views 文件夹中

    添加重写基础

    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
    

    【讨论】:

    • 默认控制器已设置为正确的管理控制器。视图和模型也存在,因为一切都在本地主机上工作。
    • 在实时服务器上尝试访问站点 site.com/index.php 并且没有 index.php 如果它被加载还确保在 php.ini 中将 mod rewrite 设置为启用
    • 尝试使用 RewriteBase /
    • 谢谢。如果我尝试使用 RewriteBase,我会得到一个不同的错误:类型:RuntimeException 消息:无法找到您指定的模型:Admin_model 文件名:/home/meshicreations/public_html/meshilabel/system/core/Loader.php 行号:344 回溯: 文件:/home/meshicreations/public_html/meshilabel/application/controllers/Admin.php 行:29 功能:模型 文件:/home/meshicreations/public_html/meshilabel/index.php 行:292 功能:require_once
    • 请注意,视图、模型和控制器都存在并且路径也是正确的。
    猜你喜欢
    • 1970-01-01
    • 2017-08-12
    • 2011-09-01
    • 2014-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-24
    相关资源
    最近更新 更多