【问题标题】:CodeIgniter Server ErrorCodeIgniter 服务器错误
【发布时间】:2013-02-15 10:49:18
【问题描述】:

在我的 codeigniter 应用程序中,有 10 个控制器,但其中 2 个出现服务器错误,这是什么问题?

在我的控制器中:

function index($offset='') {
    $this->load->model('branch_model','branch');
    .....
    $limit = 5;
    $data = $this->branch->page($limit, $offset);
    .....
    $this->load->view('branch', array(
        'branch'=>$data
    ));
}

如果我用 echo 'hi' 插入;什么都没有出现,只是服务器错误,那是什么?

【问题讨论】:

  • 可以粘贴服务器错误吗?
  • 服务器错误网站在检索www.**********l.com/admin/tiket/时遇到错误。它可能因维护而停机或配置不正确。以下是一些建议: 稍后重新加载此网页。 HTTP 错误 500(内部服务器错误):服务器尝试完成请求时遇到了意外情况。
  • 增加日志级别(通过将 index.php 文件中的环境变量更改为开发)然后刷新页面...
  • 检查以确保您没有将application/config.php 中的$config['compress_output'] 设置为TRUE

标签: codeigniter controller


【解决方案1】:

您确定您的控制器正在扩展 CI_Controller 类并且您的模型正在扩展 CI_Model 类吗?

【讨论】:

  • 是的,控制器是 CI_Controller,模型是 CI_Model
  • 伙计们,有人帮帮我吗?!
  • 这是我一生中在 CI 中做过的唯一一件没有错误的空白页:扩展错误的类/模型。只要将 index.php 文件设置为开发模式,我所做的所有其他事情都会导致一般错误。您确定它与您的 .htaccess 文件(如果有的话)或其他文件无关吗?
  • 这是我的 htaccess: RewriteEngine on RewriteCond %{HTTP_HOST} ^arifintravel\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.arifintravel\.com$ RewriteRule ^mail\/?$ "https\:\/\/www\.google\.com\/a\/arifintravel\.com\/ServiceLogin\?service\=mail\&passive\=true\&rm\=false\&continue\=http\: \/\/mail\.google\.com\/a\/arifintravel\.com\/\&ltmpl\=default\&ltmplcache\=2" [R=301,L] #RewriteBase /
  • #删除用户对系统文件夹的访问。 #Additionally 这将允许您创建一个 System.php 控制器,#previously 这不可能。如果您已重命名系统文件夹,则可以替换 #'system'。 RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #当你的应用文件夹不在系统文件夹中时 #这个sn-p防止用户访问应用文件夹#提交者:Fabdrol #Rename 'application' 为您的应用程序文件夹名称。
猜你喜欢
  • 1970-01-01
  • 2015-02-03
  • 2017-12-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-03
  • 1970-01-01
  • 2018-02-22
相关资源
最近更新 更多