php - Zend Framework 上的公共(public)文件夹

标签 php zend-framework .htaccess frameworks

我安装了 Zend Framework,但这里有一个大问题。当我进入应用程序的公共(public)文件夹(localhost/webserver/project/public/)时,我遇到了这个错误:

An error occurred

Page not found

Exception information:

Message: Invalid controller specified (public)

Stack trace:

0 C:\webserver\project\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))

1 C:\webserver\project\library\Zend\Application\Bootstrap\Bootstrap.php(97): >end_Controller_Front->dispatch()

2 C:\webserver\project\library\Zend\Application.php(366): >Zend_Application_Bootstrap_Bootstrap->run()

3 C:\webserver\project\public\index.php(40): Zend_Application->run()

4 {main}

Request Parameters:

array (

'controller' => 'public',

'action' => 'index',

'module' => 'default',

)

我的公用文件夹被解释为 Controller 。 我正在使用 Xampp 在 Apache2.2 和 PHP5.3 中运行该应用程序。

我在 htdoc 上设置的 Document_Root 是“C:/webserver”,因为我在同一服务器上使用其他应用程序。我在公共(public)文件夹的 htaccess 中使用重写规则。

SetEnv APPLICATION_ENV development

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

我怎样才能做到这一点?

最佳答案

打开您的 application.ini 并添加

resources.frontController.baseurl = "webserver/project/public"

关于php - Zend Framework 上的公共(public)文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10144643/

相关文章:

php - Laravel - 针对不同用户使用唯一参数重复输入

PHP 一次和定时间隔 Ping 多个 IP

php - 从 url 中删除 app/webroot

php - Zend_Registry 不工作!设置和获取

.htaccess - 如何将选定的页面从 HTTP 重定向到 HTTPS

php - 图像文件未在 Apache Linux Fedora 17 中加载。403 禁止错误

php - 如何附加到字符串中的所有网址?

使用 ajax 提交时,PHP post 请求总是返回 400

zend-framework - 如何使用 Zend DB 获取列名

php - getDbTable()->select()->where 问题 (Zend Framework 1.x)