【问题标题】:Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Resource matching "frontController" not found未捕获的异常“Zend_Application_Bootstrap_Exception”,消息“未找到与“frontController”匹配的资源
【发布时间】:2013-09-06 14:25:03
【问题描述】:

这是我在 Zend 中的第一个程序,我使用 zf create project abc 创建了一个项目。 在运行程序时出现以下错误 " 致命错误:在/usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/BootstrapAbstract.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): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap(NULL) #3 /var/www/zuund/public/index.php(25): Zend_Application->bootstrap() #4 {main} 抛出 /usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/ BootstrapAbstract.php 第 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

等待回复

【问题讨论】:

    标签: zend-framework controller


    【解决方案1】:

    非常感谢!您的提示(在 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
    

    【讨论】:

      【解决方案2】:

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

      所以先浏览一下zend的骨架应用程序,了解它是如何工作的,这对你很有帮助,

      这是链接,

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

      还有一个包含完整代码和解释的示例,

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

      希望对你有帮助..

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-07-14
        • 2014-01-23
        • 1970-01-01
        • 1970-01-01
        • 2020-03-30
        • 1970-01-01
        • 1970-01-01
        • 2017-06-28
        相关资源
        最近更新 更多