我想向您寻求有关在 IIS 7.5 版上部署 Codeigniter 应用程序的帮助。我已经尝试在这里阅读与 Codeigniter 和 IIS 相关的其他帖子,但它们都不起作用。我使用 CodeIgniter 1.7 开发了一个在 Apache 中运行良好的应用程序,但我无法让它在 Windows 7 Ultimate 下的 IIS 7.5 中运行。

首先,php 已经在服务器中工作,我按照所有步骤使其工作,我还安装了 IIS_UrlRewriteModule,我认为这是 php 应用程序工作和使用 htaccess 等文件所必需的。(附件是服务器中phpinfo的JPG)。这是一个本地服务器 IIS 7.5。
之后确保 PHP 工作正常,我将 Web 应用程序的文件夹放在 C:\inetpub\wwwroot\ 中,这是我在 apache 中使用的 .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /application/index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /application/index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ application/index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin
    ErrorDocument 404 index.php
</IfModule>
我读到,使用 IIS 你必须使用 web.config 文件,所以我根据 stackoverflow 的另一篇文章的示例创建了一个文件,它具有以下代码:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="MyRule"> <match url="^(.*)$" /> 
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration> 
但是,当我转到“http://localhost/application”时,我得到了这个:

如果我输入“http://localhost/application/index.php”,我会得到错误 500。如果我在应用程序根目录中只有 web.config,或者如果我在根目录中有 .htaccess,我会遇到同样的情况。我不知道该怎么办,请帮助我。