Cakephp在IIS中不起作用?
问题描述:
我在IIS上遇到CakePHP版本3.2的问题。但是,CakePHP 2.2版在相同的安装环境下运行良好。不知道为什么?Cakephp在IIS中不起作用?
这是我的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效果很好。
答
我想回答我自己的问题,我如何解决问题。问题不在web.config中,但真正的问题在于.gitignore。
默认情况下,它将vendor
目录添加到.gitignore。由于它没有添加到git,所以发生了这些错误。
您应该检查错误日志并发布相关消息。 – Sevvlor