0

这是我在 Zend 中的第一个程序,我用 zf create project abc 创建了一个项目。在运行程序时,我收到以下错误“致命错误:未捕获的异常 'Zend_Application_Bootstrap_Exception' 并在 /usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/BootstrapAbstract 中找到消息“资源匹配“frontController”未找到”。 php:694 堆栈跟踪:#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) ):

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

等待回复

4

2 回答 2

0

您是否创建了任何控制器和视图脚本?它会首先在 application/controller 中搜索 index controller ,看起来你还没有创建任何控制器,你只是在创建后运行你的程序,

所以只需先浏览一下zend的骨架应用程序并了解它是如何工作的,这将对您非常有帮助,

这是链接,

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

以及另一个带有总代码和解释的示例,

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

希望能帮助到你..

于 2013-09-03T11:57:14.403 回答
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
于 2015-03-17T16:36:28.977 回答