IIS HTTP 错误 403.18 - ASP.NET MVC 3(安装了 PHP 5.3?)

IIS HTTP 错误 403.18 - ASP.NET MVC 3(安装了 PHP 5.3?)

当我在 IIS 服务器上设置 ASP.NET MVC3 应用程序时出现此错误。

HTTP Error 403.18 - Forbidden

The specified request cannot be processed in the application 
pool that is configured for this resource on the Web server.

然而奇怪的是下面出现了详细的错误信息:

Module IIS Web Core

Notification

BeginRequest

Handler
PHP53_via_FastCGI

Error Code
0x00000000

Requested URL
http://localhost:80/index.php?q=OCOM/Account/LogOn

Physical Path
C:\inetpub\wwwroot\index.php

Logon Method
Not yet determined

Logon User
Not yet determined

是否存在某种“错误配置”,即 PHP 引擎以某种方式将 ASP.NET MVC3 请求解释为 php 请求?坦率地说,我不太明白哪里出了问题,因为我的本地机器在类似的设置下运行良好(使用 Microsoft Web PI 安装 PHP 等)

答案1

我猜测你已经在网站根目录中为 index.php 设置了 URL Rewrite。

因此,如果您在子目录中运行 MVC 应用程序,则可以取消注册该子目录的 index.php URL 重写。

为此,只需打开 IIS 管理器,单击您的网站下的子目录,然后使用“过滤器:”框键入“rewrite”,它就会让您进入 URL 重写配置区域。

然后,您可能会看到列出的重写规则,您需要选择该规则(单击一次)并点击右侧的“禁用规则”。

好的?

答案2

查看该站点/目录的处理程序映射。您应该会看到 PHP53_via_FastCGI 的条目。这应该会删除 FastCGIModule。

...或者您可以将其添加到您的 web.config 中

或者您可以将其添加到您的 web.config 中

<handlers>
    <remove name="PHP53_via_FastCGI" />
</handlers>

这应该适用于任何处理程序。有些人可能正在获取不同的版本或不同的处理程序。只需将“PHP53_via_FastCGI”替换为任何其他内容即可。(例如 PHP60_via_FastCGI)

相关内容