2011-03-01 91 views
2

我從Windows到Ubuntu的移動我的項目,有這個錯誤試圖運行項目:Zend Framework:指定了無效的控制器(錯誤)?幫助

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with 
message 'Invalid controller specified (error)' in 
/home/truong/webdev/qtcmsv2/library/Zend/Controller/Dispatcher/Standard.php:248 
Stack trace: 
#0 /home/truong/webdev/qtcmsv2/library/Zend/Controller/Front.php(954): 
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), 
Object(Zend_Controller_Response_Http)) 
#1 /home/truong/webdev/qtcmsv2/library/Zend/Application/Bootstrap/Bootstrap.php(97): 
Zend_Controller_Front->dispatch() 
#2 /home/truong/webdev/qtcmsv2/library/Zend/Application.php(366): 
Zend_Application_Bootstrap_Bootstrap->run() 
#3 /home/truong/webdev/qtcmsv2/index.php(56): 
Zend_Application->run() 
#4 {main} thrown in 
/home/truong/webdev/qtcmsv2/library/Zend/Controller/Dispatcher/Standard.php 
on line 248 

我確實有ErrorController.php文件在我的默認模塊:

class ErrorController extends Zend_Controller_Action { 
    /** 
    * This action handles 
    * - Application errors 
    * - Errors in the controller chain arising from missing 
    * controller classes and/or action methods 
    */ 
    public function errorAction() 
    { 
    $errors = $this->_getParam('error_handler'); 
    switch ($errors->type) { 
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: 
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION: 
    // 404 error -- controller or action not found 
    $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found'); 
    $this->view->title = 'HTTP/1.1 404 Not Found'; 
    break; 
    default: 
    // application error; display error page, but don't change 
    // status code 
    $this->view->title = 'Application Error'; 
    break; 
    } 

    $this->view->message = $errors->exception; 
    } 

} 

我的項目在Windows中運行得非常順利,但上面的錯誤總是在Ubuntu中運行時發生。 我該如何解決這個問題?請幫幫我! ps:抱歉我的英文不好。

+0

我有同樣的問題,我意識到錯誤控制器輸錯** ErrorControler ** .php,所以我拼湊到** ErrorController ** .php – vrunoa 2012-12-26 17:02:15

回答

1

意味着ZF無法找到錯誤控制器,因此可能是某些東西不屬於它的位置,某些東西配置不正確(如路徑),錯誤名稱,權限關閉等等。很難從信息中知道你提供的錯誤可能是在index.php,你的引導程序,配置等。

相關問題