2012-04-12 13 views
0

ファイルまたはをautoload.phpに自動ロードすると、http:// 500となり、時には空の出力となります。 MYControllerInterface.phpはapplication/librariesの下にあります。CodeIgniterファイルの拡張が原因http 500

私はディレクトリ全体を0777にchmod'edしました。ルートディレクトリに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 

を繰り返し続けて:あなたはsystem/librariesフォルダにこのファイルを置くことができる

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

を、それを使用します。 – kirilloid

+0

どこで見つけることができますか? Mac OS Xで – OZZIE

+0

xdebugを設定して、コードにいくつかのブレークポイントを設定してみてください。それはあなたに何がうまくいかないのかのより良い手がかりを与えるはずです。 – alxbrd

答えて

1

コントローラー(コアクラス)を拡張する場合は、/ application/coreに移動する必要があります。

また、プレフィックスをチェックすると、CI2標準はMY_($ config ['subclass_prefix']の109行目を確認してください)です。

UPDATE拡張コントローラ(Loaderクラスごとに)MY_Controller呼び出さなければなりません。

あなたは、問題がどこにあるあなたは、見つけるために、 `apache`と` codeigniter`のログを見てする必要があります...のような

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

は何の違いもありません: – OZZIE

+0

更新された答え – Rooneyl

+0

私はまだ気付いていませんが、私にはまだ気づいていません。 – OZZIE

-1

それを拡張しようとします。

+1

まずシステムフォルダに何かを置いてはいけません.2番目のファイルはライブラリではなくコントローラフォルダ内になければなりません。 – safarov

関連する問題