2012-04-12 64 views
0

如果我延長下面的文件OR只是自動加載它autoload.php我得到的是HTTP 500,有時空輸出。 MYControllerInterface.php位於應用程序/庫下。笨擴展文件會導致HTTP 500

我已經將整個目錄(recursivly)chmod到0777.我已經在根目錄下用RewriteEngine On和Off創建了一個.htaccess。

我註釋掉一切從{}到在MYcontrollerInterface ...

我試着刪除的結局?>

我檢查了mod_rewrite已在PHP配置啓用...這太神祕了!

<?php 
class MYcontrollerInterface extends CI_Controller { 
    public function __construct() { 
     parent::__construct(); 
     //$this->load->helper('url'); 
    } 

    function build_page($main_content_view, $data) { 
     /* 
     $this->load->view('header', $data);  
     //$this->load->view('content', $data);  
     //$this->load->view($main_content_view, $data, true); 
     $this->load->view('footer', $data); 
     */  
     echo 'apa'; 
    } 
} 

/* End of file MycontrollerInterface.php */ 
/* Location: ./application/controllers/MYcontrollerInterface.php */ 
?> 

應用/日誌/日誌2012-04-12.php:

DEBUG - 2012-04-12 13:21:22 --> Config Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Hooks Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Utf8 Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> UTF-8 Support Enabled 
DEBUG - 2012-04-12 13:21:22 --> URI Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Router Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Output Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Security Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Input Class Initialized 
下面

不斷重複:

DEBUG - 2012-04-12 13:21:22 --> Global POST and COOKIE data sanitized 
DEBUG - 2012-04-12 13:21:22 --> Language Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Loader Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Controller Class Initialized 
DEBUG - 2012-04-12 13:21:22 --> Final output sent to browser 
DEBUG - 2012-04-12 13:21:22 --> Total execution time: 0.0320 
DEBUG - 2012-04-12 13:21:38 --> Config Class Initialized 
DEBUG - 2012-04-12 13:21:38 --> Hooks Class Initialized 
DEBUG - 2012-04-12 13:21:38 --> Utf8 Class Initialized 
DEBUG - 2012-04-12 13:21:38 --> UTF-8 Support Enabled 
DEBUG - 2012-04-12 13:21:38 --> URI Class Initialized 
DEBUG - 2012-04-12 13:21:38 --> Router Class Initialized 
DEBUG - 2012-04-12 13:21:38 --> Output Class Initialized 
DEBUG - 2012-04-12 13:21:38 --> Security Class Initialized 
DEBUG - 2012-04-12 13:21:38 --> Input Class Initialized 
+1

你需要看看'apache'和'codeigniter'日誌,找出,問題出在哪裏。 – kirilloid 2012-04-12 11:32:15

+0

我可以在哪裏找到那些?在mac os x – OZZIE 2012-04-12 11:33:44

+0

嘗試設置xdebug並通過您的代碼設置一些斷點。這應該讓你更好地瞭解發生了什麼問題。 – alxbrd 2012-04-12 11:36:58

回答

1

如果你正在擴展一個控制器(這是一個核心類),它需要進入/ application/core。

同時檢查您的前綴,CI2標準是MY_(請在第109行檢查您的$ config ['subclass_prefix'])。

UPDATE一個擴展控制器必須被調用MY_Controller(按照loader類)。

然後,您可以使用它像...

class foo extends MY_Controller { 
    function __construct() { 
     parent::construct(); 
    } 
} 
+0

不作雖然:( – OZZIE 2012-04-12 11:47:26

+0

檢查有什麼區別更新答案 – Rooneyl 2012-04-12 12:24:24

+0

剛纔我注意到了這個自己,但爲什麼仍然不清楚我.. – OZZIE 2012-04-12 12:28:39

-1

你可以把這個文件中的文件夾system/libraries並嘗試擴展它。

+1

首先你不應該把任何東西到系統文件夾,第二個是文件必須是內部控制的文件夾,而不是庫 – safarov 2012-04-12 11:39:54