WebDevNick
WebDevNick

Reputation: 31

Installing Laravel 4 on Windows IIS Inetpub wwwroot

Having spent an entire day wrestling with this, could someone please explain how I can install Laravel on Windows ?

I have installed the very latest version of PHP 5.4 (using Windows Installer) and tested that with a simple site and that all works fine.

I have installed the latest version of Composer and that all installed perfectly.

When I run composer create-project laravel/laravel (as advised with the 5 Minute Setup), it installs all the files in C:\Windows\SysWOW64\laravel.

If I then set up a simple "Hello World" Laravel website within inetpub\wwwroot, it just doesn't seem to detect Laravel and throws a generic error.

I can't use XAMMP because many of my clients have Windows hosting, so I would eventually have to deploy the website to the inetpub\wwwroot directory.

Do I need to copy the Laravel files to every new Laravel website that I develop ?

How do I set the default file within web.config ?

As much as I'd dearly love to start developing with Laravel, the configuration process on a Windows development machine is just prohibitively complicated.

I'd be really grateful for any help, advice and pointers that anyone could please offer.

Upvotes: 3

Views: 5181

Answers (1)

kJamesy
kJamesy

Reputation: 6233

Ok, I've done this before and it worked alright. What I would do is deploy my tests on a local server such as Wamp. When you are ready for production, simply push it to your remote server and then make the webconfig changes corresponding to the .htaccess:

  1. Define the website root as installation-directory/public
  2. Inside the public folder, try this web.config

        <configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="default.aspx" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
            </files>
        </defaultDocument>
        <handlers accessPolicy="Read, Execute, Script" />
        <rewrite>
            <rules>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
    </configuration> 
    

Upvotes: 6

Related Questions