Home  >  Article  >  Backend Development  >  ZendFramework入门时异常

ZendFramework入门时异常

WBOY
WBOYOriginal
2016-06-13 10:01:08770browse

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参考

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn