13

I am deploying a laravel application inside windows based docker container using IIS. When I run the application after running docker container the server.php page present at C:\inetpub\wwwroot works fine. However, C:\inetpub\wwwroot\public\index.php returns 500 error. I have enabled the logs, run composer update and applied directory permissions as well. But still no luck.

IIS10 PHP 7.0 Laravel 5.5

The log message is

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 file:

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

8
  • Can you paste your log here? Commented Feb 14, 2018 at 13:06
  • The laravel.log file is empty due to some reason. Commented Feb 14, 2018 at 13:21
  • You have to enable logging and set right permissions on log file. Is your php display_error on? Commented Feb 14, 2018 at 13:24
  • Display_error is on. When I check permissions of log file using PS it shows Access NT Authority\Interactive Allow FullControl Commented Feb 14, 2018 at 13:31
  • I think you have to check docker log that is in /var/lib/docker/containers/<container id>/<container id>-json.log Commented Feb 14, 2018 at 13:37

4 Answers 4

2

From the top of my head, these are the errors that I faced when setting up laravel:

1- Directory storage permissions

2- Directory bootstrap permissions

3- composer update

4- .env file is available

5- .env key is generated

6- database is there

7- database is configured correctly in .env

8- php artisan serve if the virtual server not configured

and if i got any of those i restart the server to update the values.

if the application was a repo and gave an error, sometimes the below artisan commands save the day:

php artisan cache:clear php artisan route:clear php artisan config:clear php artisan view:clear

Sign up to request clarification or add additional context in comments.

Comments

0

500.19 errors usually occur when you have configuration files that are not well formed. Enable Detailed errors in IIS and reproduce the issue. You will get a clear idea as to what is going wrong.

To enable Detailed errors in IIS - Click on the website ---> HTTP Errors--->Edit Feature Settings---->Detailed Errors.

Or you can follow this as well - https://blogs.msdn.microsoft.com/rakkimk/2007/05/25/iis7-how-to-enable-the-detailed-error-messages-for-the-website-while-browsed-from-for-the-client-browsers/

1 Comment

I am deploying the image inside a docker container (Windows based). So this won't work unless there is some PS script available.
0

You can use the import rule on IIS View Apache Import Rule

Take a look on stackoverflow thread Laravel .htaccess rewrite rule convertion to IIS

If nothing will helpful check the "storage" folder permission in your project. Usually 500 comes with write permission or mis-configuration of server, may be due write permission error, the laravel.log may be empty!

Comments

0

A 500 error is a Server Error. Seeing that your server.php page works fine, I would not think anything in your configuration files is causing the error. More likely that not, there is some php code in your index.php page that is causing the error. I suggest using xdebug to step through your code to locate the error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.