让 IIS 服务器与 Zend 一起工作

发布于 2024-12-07 12:06:29 字数 259 浏览 0 评论 0原文

我正在尝试让我的网站与我在服务器上安装的 IIS 一起工作。我还安装了 Plesk 控制面板。

我正在尝试:

  1. 让它在公共文件夹中查找index.php,而不仅仅是在httpdocs文件夹中。

  2. 使 mod_rewrite 工作(我已将 public 文件夹中的所有内容提取到 httpdocs 文件夹中以检查是否有效,并且它确实加载了基本页面,但找不到其他任何内容,并说该文件不是在服务器上找到)。

I am trying to make my site work with the IIS I have installed on the server. I also have plesk control panel installed.

I am trying to:

  1. make it look for the index.php inside the public folder and not just the httpdocs folder.

  2. make the mod_rewrite work (i've extracted everything out of the public folder to the httpdocs folder to check if that would work, and it does load the basic page, but can't find anything else and says that file was not found on server).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

罪歌 2024-12-14 12:06:29

有许多与此相关的链接可以帮助您找到方法。正如 @Mathieu 所说,mod_rewrite 仅适用于 Apache 服务器,不适用于 IIS。为此,您需要 IIS URL Rewrite 之类的东西。

以下链接似乎包含非常准确的信息:

希望有帮助,

There is a number of links about this that can help you find your way. As @Mathieu said, mod_rewrite works only for the Apache server, not for IIS. You'll need something like IIS URL Rewrite for that.

The following links seem to contain quite accurate information:

Hope that helps,

半枫 2024-12-14 12:06:29

首先,mod_rewrite仅适用于unix风格的服务器,.htaccess不适用于IIS。因此,任何通过 htaccess 提供路由的 MVC 框架都会遇到很多问题。

其次,IIS 和 PHP 存在许多性能问题,并且许多功能的工作方式与实际 PHP/UNIX 环境不同。首先(除非他们改变了它)你不能使用 / 作为文件路径,并且必须将所有路径更改为 \ (转义反斜杠),这会变得很麻烦或使用 PHP_DS 常量并使你的代码混乱......建议,使用基于 apache 的服务器,apache可以安装在windows上。

最后,在 IIS 中,您可以简单地将网站目录指向公共文件夹,但如果您使用 ISAPI 模块,则可能需要允许 pĥp 在目录结构中向后移动。我记得有一次 ASP 必须允许向后访问文件才能离开 IIS 网站的根文件夹。如果您将 CGI 版本的 php 与 IIS 一起使用,则可能不会遇到此问题。

之后

First of all mod_rewrite is only for unix-style servers, .htaccess doesn't work with IIS. So you'll have a lot of problem with ANY MVC framework which offer routing via htaccess.

Second, IIS and PHP have many performance issues and many functions work differently from live PHP/UNIX environments. First thing (Unless they changed it) you can't use / for file paths and must change all your paths for \ (escape the backslash) which becomes cumbersome or use PHP_DS constant and clutter your code... Suggestion, use an apache based server, apache CAN be installed on windows.

Finaly, in IIS you can simple point your website directory into the public folder, but you might need to allow pĥp to move backwards in your directory structure if you use the ISAPI module. I remember once that ASP had to allow backward access in files to get out of the root folder of your IIS website. If you use the CGI version of php with IIS, you will probably NOT have this issue.

later

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文