未捕获的异常 'Zend_Controller_Dispatcher_Exception' [英] Uncaught exception 'Zend_Controller_Dispatcher_Exception'

查看:26
本文介绍了未捕获的异常 'Zend_Controller_Dispatcher_Exception'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 zend 框架上遇到以下错误:

<前>致命错误:在 F:\wamp\www\helloworld\library\Zend\Controller\Dispatcher\Standard.php:245 中出现未捕获的异常Zend_Controller_Dispatcher_Exception",消息指定控制器无效(错误)"堆栈跟踪:#0 F:\wamp\www\helloworld\library\Zend\Controller\Front.php(946):Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))#1 F:\wamp\www\helloworld\library\Zend\Controller\Front.php(212): Zend_Controller_Front->dispatch()#2 F:\wamp\www\helloworld\web_root\index.php(10): Zend_Controller_Front::run('../application/...')#3 {main} 在 F:\wamp\www\helloworld\library\Zend\Controller\Dispatcher\Standard.php 第 245 行中抛出

这是什么原因造成的,我该如何解决?

解决方案

在 index.php 文件中写入

$frontController->setParam('useDefaultControllerAlways', true);
$frontController->dispatch();

或者,您可以在 application.ini 文件的 [production] 部分编写以下行:

resources.frontController.params.useDefaultControllerAlways = 1

I am getting the following error on zend framework:

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in F:\wamp\www\helloworld\library\Zend\Controller\Dispatcher\Standard.php:245 
Stack trace: 
#0 F:\wamp\www\helloworld\library\Zend\Controller\Front.php(946):Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))  
#1 F:\wamp\www\helloworld\library\Zend\Controller\Front.php(212): Zend_Controller_Front->dispatch()  
#2 F:\wamp\www\helloworld\web_root\index.php(10): Zend_Controller_Front::run('../application/...')  
#3 {main} thrown in F:\wamp\www\helloworld\library\Zend\Controller\Dispatcher\Standard.php on line 245

What is causing this, and how can I fix it?

解决方案

In index.php file write

$frontController->setParam('useDefaultControllerAlways', true);
$frontController->dispatch();

Alternatively you can write following line in [production] section of application.ini file:

resources.frontController.params.useDefaultControllerAlways = 1

这篇关于未捕获的异常 'Zend_Controller_Dispatcher_Exception'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆