在IIS上使用Silex框架时遇到麻烦

时间:2014-06-19 18:02:19

标签: symfony iis iis-7.5 silex

我正在尝试配置silex框架,只是让一个示例应用程序正常工作。我使用的是IIS服务器版本7.5。在下面的website中,它给了我一个我应该使用的示例web.config文件。该文件如下:

<?xml version="1.0"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
            </files>
        </defaultDocument>
        <rewrite>
            <rules>
                <rule name="Silex Front Controller" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

问题是当我尝试导航到网站时我得到错误:

  

由于相关,无法访问请求的页面   页面的配置数据无效。

基本上IIS说文件不正确,但我对这些文件没有多少经验,所以我不知道是否有问题。也许该文件已过时,而较新的版本不适用于较新版本的IIS。服务器日志中没有任何内容。有没有人遇到过这个问题?

1 个答案:

答案 0 :(得分:0)

原来我只需要在以下链接安装IIS的重写模块:

http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module