Laravel on IIS

Note: PHP for Windows comes in two flavors, Non Thread Safe (NTS) and Thread Save (TS). If you are using PHP as a FastCGI or CGI executable you need to use the NTS flavor. This is the only flavor you should be using for IIS and NginX. It’s also the preferred way to set up PHP on Apache. Reference

  • Download the latest NTS (Non Thread Safe) 7.3 64 bit version of PHP
    • Unzip PHP Files to a folder C:\Program Files\PHP\v7.3\ (change version to whatever PHP version you are using)
    • Add to above folder to System Path
    • reboot
    • Rename php.ini-production → php.ini
  • Enable php for SQL
    • Download PHP SQL Drivers (ODBC Drivers)
      • Microsoft Drivers 5.6 for PHP for SQL Server
      • Run the installer / extractor and copy the below files to C:\Program Files\PHP\v7.4.2\ext\
  • PHP.ini Config file
    • Uncomment the line:
      extension_dir = "ext"
  • Add the following lines at the end of the php.ini file:
; Microsoft SQL for Laravel
  • Install Laravel
composer global require laravel/installer

Configure IIS for your laravel project

Summary of Steps

  • Copy your Laravel Project to C:\inetpub\laravel\<projectname>\
  • Give <servername>\IIS_IUSRS full access to the Storage folder
  • Create a virtual Directory for your Default Site to the public folder of your laravel project, e.g.


  • enable full access for the user <servername>\IIS_IUSRS for the laravel storage folder
  • Add the below IIS web.config file to the public folder
                <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" />
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)/$" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    <action type="Redirect" redirectType="Permanent" url="/{R:1}" />
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    <action type="Rewrite" url="index.php" />
        <httpErrors errorMode="Detailed" />
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies