【发布时间】:2018-02-14 13:03:25
【问题描述】:
我正在使用 IIS 在基于 Windows 的 docker 容器中部署一个 laravel 应用程序。 当我在运行 docker 容器后运行应用程序时,位于 C:\inetpub\wwwroot 的 server.php 页面工作正常。但是,C:\inetpub\wwwroot\public\index.php 返回 500 错误。我也启用了日志、运行 composer update 并应用了目录权限。但还是没有运气。
IIS10 PHP 7.0 Laravel 5.5
日志消息是
GET /public/index.php - 80 - 172.18.224.1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+Touch;+rv:11.0)+like+Gecko - 500 19 13 1
web.config 文件:
<configuration>
<staticContent>
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
【问题讨论】:
-
你能把你的日志贴在这里吗?
-
由于某种原因,laravel.log 文件为空。
-
您必须启用日志记录并在日志文件上设置正确的权限。你的 php display_error 开启了吗?
-
Display_error 已开启。当我使用 PS 检查日志文件的权限时,它显示 Access NT Authority\Interactive Allow FullControl
-
我认为你必须检查
/var/lib/docker/containers/<container id>/<container id>-json.log中的docker日志