“指定的控制器无效” zend框架错误
我使用 zf 工具在“http://localhost/work/qwafel”中创建一个项目,
我创建了它的 url“http://localhost/work/qwafel/public”显示索引控制器索引操作正常。但是当我导航到“http://localhost/work/qwafel/public/index”时,我收到此错误
An error occurred
Page not found
Exception information:
Message: Invalid controller specified (work)
Stack trace:
#0 C:\xampp\htdocs\Work\qwafel\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 C:\xampp\htdocs\Work\qwafel\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 C:\xampp\htdocs\Work\qwafel\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 C:\xampp\htdocs\Work\qwafel\public\index.php(26): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'controller' => 'work',
'action' => 'qwafel',
'public' => 'index',
'module' => 'default',
)
,我不知道为什么我使用 zf 工具创建了许多项目,但它工作正常,
没有人在那里?帮助!!
i used zf tool to create a project in "http://localhost/work/qwafel"
i created it the url "http://localhost/work/qwafel/public" display index controller index action ok. but when i navigate to "http://localhost/work/qwafel/public/index" i got this error
An error occurred
Page not found
Exception information:
Message: Invalid controller specified (work)
Stack trace:
#0 C:\xampp\htdocs\Work\qwafel\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 C:\xampp\htdocs\Work\qwafel\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 C:\xampp\htdocs\Work\qwafel\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 C:\xampp\htdocs\Work\qwafel\public\index.php(26): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'controller' => 'work',
'action' => 'qwafel',
'public' => 'index',
'module' => 'default',
)
I don't know why i created many projects with zf tool it was working properly
nobody there? help!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您使用 zf 命令行工具创建 zf 项目时,它始终具有一个 IndexController 和一个 indexAction 函数。所以你应该能够运行它。
但是您的项目设置似乎有问题。我可以将我的 zend 项目复制到 htdocs 文件夹中的任何目录,它仍然可以工作。
打开命令行工具并导航到任意目录并创建项目:
不要修改项目,将其复制到 htdocs 中的任意文件夹。现在对我来说一切都很好。
Well when you create a zf-project using zf command line tool it always has a
IndexController
and anindexAction
function. So you should be able to run it.However there seems to be something wrong with your project setup. I can copy my zend project to any directory in my htdocs folder, it will still work.
Open command line tool and navigate to any directory and create a project:
Don't modify the project, copy it to any folder in htdocs. Everything is fine for me right now.
在子文件夹中安装 Zend Framework 有点棘手。
编辑您的 .htaccess 以具有:
应该可以...
To install Zend Framework in a sub-folder is a little more tricky.
Edit your .htaccess to have:
That should do it...