CodeIgniter的默认控制器无法加载 [英] CodeIgniter's default controller doesn't load

查看:165
本文介绍了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 - http://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.


  1. 请确保数据库连接成功

  1. 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的默认控制器无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆