Zend Framework - Zend Tool - 模块错误:使用 Zend Tool 创建模块后出现错误

发布于 2024-09-04 17:25:11 字数 1930 浏览 7 评论 0原文

我是 zend 框架的新手。

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

我的步骤:

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

test 中: http://localhost/mystore/public/工作

添加模块商店(不工作)

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

    resources.frontController.moduleDirectory = APPLICATION_PATH“/modules”

    resources.modules = ""

test1: http://localhost/mystore/public/store/

test2: http://localhost/mystore/public/store/public/

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

测试1+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',
)  

谢谢,

约瑟夫

I'm new to the zend framework.

I created a zend project with zend tool, and its works. I then tried creating a module, but when I try to access it with a browser, I get an error.

My steps:

  1. $ sudo zf create project mystore
  2. put Zend library inside library

test: http://localhost/mystore/public/ (working)

Add module store (not working)

  1. $ sudo zf create module store
  2. add to application.ini path to modules

    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

    resources.modules = ""

test1: http://localhost/mystore/public/store/

test2: http://localhost/mystore/public/store/public/

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

test1+2+3 result:

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',
)  

Thanks,

Yosef

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡淡的优雅 2024-09-11 17:25:11

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

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

Do other actions/controllers work on the standard install, the case before you added the module (at the URL http://localhost/mystore/public/)? It might be possible there is something wrong with the rewrite rules in your .htaccess file.

The Routing in Zend seems to think that when you access your module the controller is index.php.

甜柠檬 2024-09-11 17:25:11

我忘记创建这个命令来创建我的模块的索引控制器。

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

I forget to make this command that create index controller of my module.

$ sudo zf create controller index index-action-included=1 store
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文