未捕获的异常' Zend_Application_Bootstrap_Exception'与消息'资源匹配" frontController"未找到

时间:2013-09-03 11:11:49

标签: zend-framework controller

这是我在Zend的第一个程序,我用zf create project abc创建了一个项目。 在运行程序时,我得到以下错误 “ 致命错误:未捕获的异常'Zend_Application_Bootstrap_Exception',消息'资源匹配'在/usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/BootstrapAbstract.php:694中找不到frontController'堆栈跟踪:#0 / usr / share / php / libzend-framework-php / Zend / Application / Bootstrap / BootstrapAbstract.php(626):Zend_Application_Bootstrap_BootstrapAbstract-> _executeResource('frontController')#1 / usr / share / php / libzend-framework-php / Zend / Application / Bootstrap / BootstrapAbstract.php(586):Zend_Application_Bootstrap_BootstrapAbstract-> _bootstrap(NULL)#2 /usr/share/php/libzend-framework-php/Zend/Application.php(355):Zend_Application_Bootstrap_BootstrapAbstract-> bootstrap (NULL)#3 /var/www/zuund/public/index.php(25):Zend_Application-> bootstrap()#main {main}抛出/ usr / share / php / libzend-framework-php / Zend / Application / Bootstrap / BootstrapAbstract.php on 694“

application.ini文件内容是

[production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    appnamespace = "Application"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" 

    resources.frontController.params.displayExceptions = 0

[staging : production]

[testing : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1

[development : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    resources.frontController.params.displayExceptions = 1

等待回复

2 个答案:

答案 0 :(得分:0)

你创建了任何控制器和视图脚本吗?它将首先在应用程序/控制器中搜索索引控制器,看起来你没有创建任何控制器,你只是在创建后运行你的程序,

所以,首先仔细阅读zend的骨架应用程序并了解它的工作原理,这对您非常有帮助,

这是链接,

http://framework.zend.com/manual/1.12/en/learning.quickstart.html

另一个带有总代码和解释的例子,

http://akrabat.com/zend-framework-tutorial/ ....

希望它有所帮助..

答案 1 :(得分:0)

非常感谢!你的提示(在app.ini中)解决了我的问题。

这是我的代码:

;application/configs/application.ini 
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"

bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0

resources.frontController.defaultControllerName = "view"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
resources.view[]="" 

[staging : production]
;resources.view.encoding = [] ="utf-8"
[testing : production]
phpSettings.display_startup_errors = 1

phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1