Installing Drupal on Windows 2016
Installing on Windows Server 2016/Windows 10
Last updated on
14 October 2017
Do not use the web platform installer for any components of your Drupal setup.
- Install the following roles:
- HTTP Redirection
- IIS Management Console
- .NET Extensibility 3.5
- .NET Extensibility 4.6
- Install the following features:
- .NET Framework 3.5
- .NET Framework 4.6
- Windows PowerShell
- Download and install the URL Rewrite module for IIS: https://www.iis.net/downloads/microsoft/url-rewrite
Install and Configure PHP
- Download the appropriate Visual C++ Redistributable for Visual Studio 2012 for your corresponding version of PHP 7.
- Download the latest non-thread safe version of PHP 7 and extract the files to “C:\php”
- Rename php.ini-production (for production servers) or php.ini-development (for development servers) to php.ini. Do not rename both.
- Uncomment (if needed) and set the following settings:
- fastcgi.impersonate = 1
- cgi.fix_pathinfo = 0 (if you get a “No input file specified option”, enable this option)
- cgi.force_redirect = 0
- extension_dir = “ext”
- error_log = “C:\inetpub\logs\php_error.log”
- curl.cainfo = “C:\php\extras\ssl\cacert.pem”
- mbstring.http_input = pass
- mbstring.http_output = pass
- Enable the following extensions:
- Your respective database extension(s)
- Add the following extensions:
- Add “C:\php” to your system PATH variable.
- Download the latest cacert.pem file from here (https://curl.haxx.se/docs/caextract.html) and move it to C:\php\extras\ssl
- In the default document settings of IIS Manager, add “index.php” as a default document.
- Open the Handler Mappings section of your host in IIS Manager and add a module mapping with the following settings:
- Required Path: *.php
- Module: FastCgiModule
- Executable: C:\php\php-cgi.exe
For more information configuring PHP for IIS, see https://docs.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php.
Install WinCache and Test PHP Installation
- Navigate to this link: https://www.iis.net/downloads/microsoft/wincache-extension#additionalDownloads
- Click the “additional downloads” link underneath the “Install this extension” button.
- Download the appropriate installer for your respective PHP version.
- Run the installer and extract the files to a temporary location.
- Copy “php_wincache.dll” to C:\php\ext\.
- Create a file called “phpinfo.php” with the code “<?php phpinfo();”. Save this file in your IIS server root (C:\inetpub\wwwroot\ by default).
- On your server, navigate to https://localhost/phpinfo. You should see the PHP info screen.
Install and Configure MySQL
Be sure to use MySQL rather than MSSQL or SQL Server.
- Download and run the MySQL Installer: https://dev.mysql.com/downloads/installer/
- Install MySQL Server, Workbench, Notifier, and Shell. If the install doesn’t work the first time, run it again and there should be no problems. If there still are problems, download the
- While configures MySQL Server, do not enable X Protocol.
- Open MySQL Workbench. If there is an error opening MySQL Workbench, uninstall and reinstall it. If you’re prompted that you OS isn’t supported by MySQL Workbench, ignore the warning.
- Create a database for your Drupal site and a user with appropriate privileges for that database.
Install Composer and Drush
Regardless of your Drupal version, do these steps to be sure Drush is globally installed on your machine.
- Download that Composer Setup executable from https://getcomposer.org/download/.
- Run the executable.
- Open an elevated command prompt or elevate power shell and run:
composer global require drush/drush
Configure Site Folder Permissions
- Create a new site in IIS Manager for your Drupal site. Be sure it has a unique Application Pool and set “Connect as…” to “Application user (pass-through authentication)”.
- Go to the Authentication section of your site’s settings. Edit “Anonymous Authentication” to be “Application pool identity”.
- Give the user “IIS APPPOOL\[app pool name]” write access to all the files in your Drupal project.
Download cURL, gzip, wget, and LibArchive (D7 only)
- Download cURL from https://curl.haxx.se/download.html and extract the files into C:\Program Files\cURL
- Download LibArchive from https://gnuwin32.sourceforge.net/packages/tar.htm. Run the installer and use the default instructions.
- Download gzip from https://gnuwin32.sourceforge.net/packages/gzip.htm. Run the installer and use the default options.
- Download wget from https://gnuwin32.sourceforge.net/packages/wget.htm. Run the installer and use the default options.
- Add C:\Program Files\cURL\bin and C:\Program Files (x86)\GnuWin32\bin to your system path variable.