我在使用 zend 框架创建模块化应用程序时遇到问题,我多次学习了更多教程和模块,但我总是遇到同样的错误。
我的应用程序的结构如下图所示。
+网站
应用
+配置
+模块
admin default
+引导程序.php
文档
图书馆
上市
测试
在每个模块中,我都有一个扩展类 Zend_Application_Module_Bootstrap 的类,分别是:
- Admin_Bootstrap
- Default_Bootstrap
我的 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
;module support
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
resources.frontController.params.prefixDefaultModule = "1"
resources.frontController.defaultModule="default"
;end module support
[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
如果我尝试访问该 urlhttp://localhost/site.it/public/
没关系,但如果我尝试访问该 urlhttp://localhost/site.it/public/admin
我收到错误 The requested URL http://localhost/site.it/public/admin
was not found on this server.
文件 .htaccess 由以下部分组成:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
怎么了?