ZendFramework入门时异常
程序员文章站
2024-02-15 08:07:28
...
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参考
不知道有没有人看过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参考
相关文章
相关视频
推荐阅读
-
ZendFramework入门时异常
-
~图片下传时发生的异常
-
关于使用file读入整个文件时出现的异常断行错误转载 我没试过,不过在读文件的时候最好还是...
-
ZendFramework框架上,在ErrorController抓住异常之前就报错(连接数过多?),该怎么获取并处理此类异常信息
-
hibernate测试时遇到的几个异常及解决方法汇总
-
Hibernate用MySQL数据库时链接关闭异常的表现
-
Java网络编程从入门到精通(19):套接字(Socket)的异常
-
无法在发生异常时创建会话,请检查 PHP 或网站服务器日志,并正确配置 PHP 安装
-
phpStudey2010中进入phpMyAdmin出现"无法在发生异常时创建会话,请检查PHP"的解决办法
-
lucene 写入索引时发生Lock obtain timed out异常 luceneCC++C#