简体   繁体   English

如何在IIS6上使用Zend Framework 2和虚拟目录?

[英]How do I use Zend Framework 2 with virtual directories on IIS6?

I'm trying to set up a Zend Framework 2 environment without success. 我试图建立一个Zend Framework 2环境但没有成功。 I've been following these instructions: 我一直在遵循这些指示:

http://framework.zend.com/manual/2.0/en/user-guide/skeleton-application.html http://framework.zend.com/manual/2.0/en/user-guide/skeleton-application.html

The one difference is that I'm trying to install it on a Virtual Directory. 一个区别是我正在尝试将其安装在虚拟目录上。 an example URL would be: 示例网址为:

http://localhost/12345678/index/index

I've got to the "Welcome to Zend Framework 2" page by typing: 我输入了以下“欢迎使用Zend Framework 2”页面:

http://localhost/12345678/index.php/

For some reason that slash at the end is important, otherwise the page won't load and I've no idea why? 出于某种原因,最后的斜线是重要的,否则页面将无法加载,我不知道为什么? I would expect the following link to work but it doesn't: 我希望以下链接可以工作,但它没有:

http://localhost/12345678/

Because we have no choice but to use IIS 6, I'm trying to use the Ionics Rewrite filter on the URL, without success. 因为我们别无选择,只能使用IIS 6,我试图在URL上使用Ionics Rewrite过滤器,但没有成功。 What I've tried so far is: 到目前为止我尝试过的是:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [NC,L]
and
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(\d*)/(.*) /$1/index.php/ [L,QSA]
and
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /12345678/index.php/ [NC,L]

I seem to be able to get to the welcome page and generic 404 error page (not the Zend 404). 我似乎能够访问欢迎页面和通用404错误页面(不是Zend 404)。 I can't get to a test controller page or even a zend error page. 我无法访问测试控制器页面甚至是zend错误页面。 Can anyone help me find out what RewriteRule to use with the Ionics IIRF.ini file that will allow me to use Zend Framework 2 with virtual directories or point me in the direction of what I'm doing wrong? 任何人都可以帮我找出与Ionics IIRF.ini文件一起使用的RewriteRule,它允许我将Zend Framework 2与虚拟目录一起使用,或者指出我正在做错的方向?

Thanks in advance!!! 提前致谢!!!

I've fixed my issue by starting again and following this tutorial, leaving out the Apache stuff: 我已经修复了我的问题,重新开始并遵循本教程,省略了Apache的东西:

http://samminds.com/2012/07/zend-framework-2-installation-on-xampp-for-windows/

I'm not entirely sure why it's working but IIS seems to be reading the .htaccess file which is great. 我不完全确定为什么它正在工作,但IIS似乎正在读取.htaccess文件,这很棒。 Of coarse this has lead me on to other issues but this one is resolved for me :). 粗略的这导致了我的其他问题,但这一个解决了我:)。 I have not answered my own question with this because I don't feel that what I have done is a proper solution to my problem. 我没有用这个回答我自己的问题,因为我不觉得我所做的就是解决我的问题。

Did you take a look at the ISAPI Rewrite module bij Helicon? 您是否看过ISAPI Rewrite模块bij Helicon? It supports Apache mod_rewrite rules syntax. 它支持Apache mod_rewrite规则语法。 I used this module in the past with ZF 1 and it worked like a charm. 我过去使用过这个模块和ZF 1,它就像一个魅力。 There's a free version available which has some limitations: http://www.helicontech.com/download-isapi_rewrite3.htm 有一个免费版本有一些限制: http//www.helicontech.com/download-isapi_rewrite3.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM