【问题标题】:Zend Framework - Zend Tool - Module error: I have error after I create module with Zend ToolZend 框架 - Zend 工具 - 模块错误:使用 Zend 工具创建模块后出现错误
【发布时间】:2010-06-08 12:43:18
【问题描述】:

我是 zend 框架的新手。

我用 zend 工具创建了一个 zend 项目,它的工作原理。然后我尝试创建一个模块,但是当我尝试使用浏览器访问它时,出现错误。

我的步骤:

  1. $ sudo zf create project mystore
  2. Zend 库 放入库中

测试http://localhost/mystore/public/工作

添加模块商店(不工作

  1. $ sudo zf create module store
  2. 添加到模块的application.ini路径

    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

    resources.modules = ""

测试1:http://localhost/mystore/public/store/

测试2:http://localhost/mystore/public/store/public/

test3:http://localhost/mystore/public/modules/store/public/

test1+2+3 结果:

An error occurred
Page not found
Exception information:

Message: Invalid controller specified (index.php)
Stack trace:

#0 /var/www/mystore/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /var/www/mystore/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /var/www/mystore/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 /var/www/mystore/public/index.php(25): Zend_Application->run()
#4 {main}  

Request Parameters:

array (
  'module' => 'store',
  'controller' => 'index.php',
  'action' => 'index',
)  

谢谢,

约瑟夫

【问题讨论】:

    标签: zend-framework zend-tool


    【解决方案1】:

    其他操作/控制器是否适用于标准安装,即添加模块之前的情况(在 URL http://localhost/mystore/public/)?您的 .htaccess 文件中的重写规则可能有问题。

    Zend 中的路由似乎认为当你访问你的模块时,控制器是 index.php。

    【讨论】:

    【解决方案2】:

    我忘记执行创建模块索引控制器的命令。

    $ sudo zf create controller index index-action-included=1 store
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-11
      • 1970-01-01
      • 1970-01-01
      • 2012-04-23
      • 1970-01-01
      • 1970-01-01
      • 2011-01-19
      • 2012-04-09
      相关资源
      最近更新 更多