【旧资料整理】解决zend framework错误 Uncaught exception 'Zend_Controller_Dispatcher_Exception' with messa

来源:互联网 发布:封装继承多态java 编辑:程序博客网 时间:2024/06/08 03:27
资料时间:2010年之前

分享时间:2010年到百度空间,空间关闭,重新整理

        zend framework错误 Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified ...的意思是未找到controller,在网上搜了好多设置controller路径的办法,都未见效,经过分析zend framework的源码发现问题是出现在了根目录上.

我是通过地址http://localhost/Zend_Framework/public/index/访问的,根目录应该是public,但是zend framework将localhost作为了根目录,将Zend_Framework当成了controller名,而将public当成了action.解决办法就是通过虚拟主机将public目录设为地址的根目录.设置方法见apache设置方法.

方法二:修改默认根目录:
$frontController = Zend_Controller_Front::getInstance();
$frontController->setBaseUrl('根目录');
注意根目录就是完整地址,没有主机名.例如果地址是http://localhost//zend_framework/public则根目录设
'/zend_framework/public'

阅读全文
0 0
原创粉丝点击