2012-10-06 36 views
0

我繼承了正在進行的CI v2.0.2項目。CodeIgniter的默認控制器不會加載

我試圖加載默認控制器 - http://localhost/ci202/index.php - 但我得到的只是一個空白頁面。

我啓用了日誌記錄的所有消息,這裏的日誌:

<?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一次。

routes.php & .htaccess的內容與CI v2.0.2的默認安裝相同。

我試着創建另一個'helloworld'類型的控制器,這是一個歡迎控制器的副本,但仍然得到一個空白頁。

我應該在哪裏尋找錯誤配置?

+2

聽起來像是你越來越死亡的白色屏幕?你有沒有試過在服務器上使用codeigniter的完全空白安裝 - 確認工作正常? – Laurence

+0

@TheShiftExchange是的,全新的CI v.2.0.2安裝在我的機器上完美運行。 –

+1

你應該檢查你的Apache錯誤日誌 - 聽起來像PHP失敗,而不是CI。 – Repox

回答

2

這可能會幫助您找到問題。

  1. 確保數據庫連接成功
  2. 如果從CI配置文件中啓用輸出壓縮,從config.php禁用它:

    $config['compress_output'] = FALSE;

  3. 更改默認環境從index.php to發展設置`,因此您可以看到應用程序中可能出現的任何錯誤:

    define('ENVIRONMENT', 'development');