CodeIgniter的默认控制器无法加载

编程入门 行业动态 更新时间:2024-10-20 13:35:48
本文介绍了CodeIgniter的默认控制器无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我继承了一个正在进行的CI v2.0.2项目。

I have inherited an on-going CI v2.0.2 project.

我尝试加载默认控制器- http:// localhost / ci202 / index.php -但我只得到一个空白页。

I tried loading the default controller - localhost/ci202/index.php - but all I got was a blank page.

我启用了所有消息的日志记录,这是日志:

I enabled logging for all messages, and here's the log:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?> DEBUG - 2012-10-05 23:55:41 --> Config Class Initialized DEBUG - 2012-10-05 23:55:41 --> Hooks Class Initialized DEBUG - 2012-10-05 23:55:41 --> Utf8 Class Initialized DEBUG - 2012-10-05 23:55:41 --> UTF-8 Support Enabled DEBUG - 2012-10-05 23:55:41 --> URI Class Initialized DEBUG - 2012-10-05 23:55:41 --> Router Class Initialized DEBUG - 2012-10-05 23:55:41 --> No URI present. Default controller set. DEBUG - 2012-10-05 23:55:41 --> Output Class Initialized DEBUG - 2012-10-05 23:55:41 --> Security Class Initialized DEBUG - 2012-10-05 23:55:41 --> Input Class Initialized DEBUG - 2012-10-05 23:55:41 --> Global POST and COOKIE data sanitized DEBUG - 2012-10-05 23:55:41 --> Language Class Initialized DEBUG - 2012-10-05 23:55:41 --> Loader Class Initialized DEBUG - 2012-10-05 23:55:41 --> Helper loaded: url_helper DEBUG - 2012-10-05 23:55:41 --> Database Driver Class Initialized

要获取此日志,我仅重新加载了 index .php 一次。

To get this log, I only re-loaded index.php once.

routes.php & .htaccess 与CI v2.0.2。的默认安装相同。

The contents of routes.php & .htaccess are the same as the default installation of CI v2.0.2.

我尝试创建另一个 helloworld类型控制器,它是welcome控制器的副本,但仍然显示空白页。

I tried creating another 'helloworld' type controller, which was a replica of the welcome controller, but still get a blank page.

我还应该在哪里寻找配置错误?

Where else should I look for misconfiguration?

推荐答案

这可能有助于您发现问题。

This may help you to find the problem.

  • 请确保数据库连接成功

  • Make sure the database connection is successful

    如果从CI配置文件中启用了输出压缩,请从 config.php中将其禁用code>:

    If you enabled output compression from CI config file, disable it from config.php:

    $ config ['compress_output'] = FALSE;

    将默认环境设置从 index.php更改为 development`,因此您可以看到应用程序中可能发生的任何错误:

    Change the default environment setting from index.php to development`, so you can see any errors that may occur in the application:

    define('ENVIRONMENT','development');

  • 更多推荐

    CodeIgniter的默认控制器无法加载

    本文发布于:2023-11-01 02:13:47,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1547950.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:控制器   加载   CodeIgniter

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!