ZendFramework入门时异常

WBOY
发布: 2016-06-13 10:01:08
原创
767 人浏览过

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

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板