2012-04-12 62 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