ZendFramework入門時異常

來源:互聯網
上載者:User
ZendFramework入門時錯誤
不知道有沒有人看過PHPWEB2.0開發實戰?這本書裡面的代碼在我的windows系統裡面總是出錯
代碼是這裡
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();

$config=new Zend_Config_Ini('../settings.ini','development');
Zend_Registry::set('config',$config);

//connect to the database
$params=array('host'=>$config->database->hostname,
'username' =>$config->database->username,
'password'=>$config->database->password,
'dbname'=>$config->database->database);

$db=Zend_Db::factory($config->database->type,$params);
Zend_Registry::set('db','$db');
$db->query('select 1');

//handle the user requerst
$controller=Zend_Controller_Front::getInstance();
$controller->setControllerDirectory($config->paths->base."/include/Controllers");
$controller->dispatch(null,null);
?>

錯誤提示是 這裡:

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in D:\PHPnow-1.5.4\include\Zend\Controller\Dispatcher\Standard.php:194 Stack trace: #0 D:\PHPnow-1.5.4\include\Zend\Controller\Front.php(920): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 D:\PHPnow-1.5.4\htdocs\index.php(24): Zend_Controller_Front->dispatch(NULL, NULL) #2 {main} thrown in D:\PHPnow-1.5.4\include\Zend\Controller\Dispatcher\Standard.php on line 194


我看了下出錯代碼的 位置就是那個194行,寫的是:
throw new Zend_Controller_Dispatcher_Exception('Invalid controller specified (' . $request->getControllerName() . ')');


剛剛接觸ZEND FRAMEWORK有點不明白,希望牛人能解開我的這個難題。。。。

------解決方案--------------------
http://topic.csdn.net/u/20090206/17/dc63dbee-0aa1-4fa5-afa9-4a741bad01b0.html參考
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.