【问题标题】:Cakephp does not work in IIS?Cakephp 在 IIS 中不起作用?
【发布时间】:2016-03-08 10:42:28
【问题描述】:

我在 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>

以上内容抄自Official Cakephp forum

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

注意

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

更多信息:

IIS 版本 - 10 Cakephp - 3.2

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

【问题讨论】:

  • 您应该检查错误日志并发布相关消息。

标签: cakephp iis cakephp-3.0 iis-10


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多