Zend Framework - Zend Tool - 模块错误:使用 Zend Tool 创建模块后出现错误
我是 zend 框架的新手。
我使用 zend 工具创建了一个 zend 项目及其工作原理。然后我尝试创建一个模块,但是当我尝试使用浏览器访问它时,出现错误。
我的步骤:
$ sudo zf create project mystore
- 将 Zend 库 放入库
test 中: http://localhost/mystore/public/(工作)
添加模块商店(不工作)
$ sudo zf create module store
添加到 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:
$ sudo zf create project mystore
- put Zend library inside library
test: http://localhost/mystore/public/ (working)
Add module store (not working)
$ sudo zf create module store
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
其他操作/控制器是否适用于标准安装,即添加模块之前的情况(位于 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.
我忘记创建这个命令来创建我的模块的索引控制器。
I forget to make this command that create index controller of my module.