-5

我在 IIS 上遇到了 Cakephp 3.2 版的问题。但是,Cakephp 2.2 版在相同的设置环境中运行良好。不知道为什么?

这是我的web.config文件。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Exclude direct access to webroot/*"
                  stopProcessing="true">
                    <match url="^webroot/(.*)$" ignoreCase="false" />
                    <action type="None" />
                </rule>
                <rule name="Rewrite routed access to assets(img, css, files, js, favicon)"
                  stopProcessing="true">
                    <match url="^(img|css|files|js|favicon.ico)(.*)$" />
                    <action type="Rewrite" url="webroot/{R:1}{R:2}"
                      appendQueryString="false" />
                </rule>
                <rule name="Rewrite requested file/folder to index.php"
                  stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <action type="Rewrite" url="index.php"
                      appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

以上内容抄自Cakephp官方论坛

无论我们在 URL 中输入什么,我都会得到以下响应

在此处输入图像描述

注意

我尝试了 SO 中的所有相关链接,并在尝试了所有提供的解决方案后发布了此链接,但没有一个有效。

更多信息 :

IIS 版本 - 10 Cakephp - 3.2

我再说一遍,Cakephp 2.2 运行良好。

4

1 回答 1

0

我想回答我自己的问题,我是如何解决这个问题的。问题不在于 web.config,但真正的问题在于 .gitignore。

默认情况下,它将vendor目录添加到 .gitignore。由于它没有添加到 git,因此发生了这些错误。

于 2016-03-10T04:22:21.123 回答