Home > Backend Development > PHP Tutorial > ZendFramework入门时异常

ZendFramework入门时异常

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:48:39
Original
915 people have browsed it

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

Related labels:
Statement of this Website
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
Latest Issues
Controller does not exist: app\controller\Test
From 1970-01-01 08:00:00
0
0
0
Controller touch?
From 1970-01-01 08:00:00
0
0
0
AngularJS via controller A to controller B
From 1970-01-01 08:00:00
0
0
0
Imitate $this->show() in TP5 Controller
From 1970-01-01 08:00:00
0
0
0
ControllerClass 'think\Controller' not found in
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template