A Comprehensive Guide to Installing WordPress on Windows and IIS

Introduction

There is no such thing as a “5 min install” for WordPress. It is a great marketing slogan. But anyone who has ever installed WordPress knows that that is all it is — marketing. And when it comes to Windows Server and IIS, there is definitely no such thing as a 5 min install. It is something closer to two or three hours of work.

This article will attempt to be as comprehensive as possible in covering the steps to successfully install WordPress on Windows Server 2012 and IIS 7.5+. It is assumed that:

  1. You have a brand new installation of Windows Server 2012, fully patched and IIS 7.5 or later installed.
  2. Your attempt to use the WebMatrix tool to install WordPress has failed with no good explanation, so you will be installing everything manually.
  3. You have a working knowledge of IIS and Windows Server in general.

This article will ask you to download a lot of software but will NOT provide links. My experience has been such that links tend to be outdated — most of the links I encountered in my research ended up with 404 errors, and so I had to do Google searches to get to the correct download pages anyway.

Part 1 — Download and Install the Prerequisites

  1. If you have tried using WebMatrix to install WordPress and were unsuccessful, you should uninstall MySQL using the Add/Remove programs control panel.
  2. Download the latest version of WordPress from this page.
  3. Create a folder and unzip the files from the download. This folder will be your primary WordPress folder.
    1. I always assume that I will have multiple WP installs on a machine, so I always create a x:\wordpress\ root folder (where x: is the drive letter).
    2. Under the above folder, I create another folder with a meaningful name such as “MyCompanyName”.  This is the folder I place the unzipped WP files into. So, the full folder name for a particular installation of WordPress is something that looks like x:\wordpress\mycompanyname.
  4. Download and install MySQL (either community edition or a commercial edition).
    1. During the installation on MySQL, you might be asked to download additional prerequisite software, so be prepared to do that.
  5. Download and install the MSVC 2013 Redistributable (search for it on the Microsoft Web Site). This is needed for the next item.
  6. Download and install MySQL Workbench.
  7. Using the MySQL WorkBench software, connect to your local MySQL install, create a new user, and give them full administrative rights.
    1. Make sure you use a STRONG password.
  8. Create a new Schema in MySQL using the MySQL WorkBench software.
  9. Grant rights to the user created in 6 above to the new schema you just created.
  10. Download and install PHP for Windows.
  11. Download and install PHP Manager for IIS.
  12. Go To IIS Manager, open up PHP Manager and let it do its “check”. Allow it to fix all errors EXCEPT the “Document” error.
    1. The document error is where it’ll try to make the default document index.php instead of default.htm. Do not allow this to occur — keep the default document as default.htm.
  13. Create a new website in IIS Manager, and point it to your WordPress folder (x:\wordpress\CompanyOrAppName\).
    1. Make sure you let IIS create the application pool for you. Manually creating the application pool will create all kinds of security errors that you will have to fix later.
  14. Turn on 32 Bit Apps for your Website since PHP is a 32 bit application.
    1. Right Mouse Click on the APPLICATION POOL name in the left panel of IIS Manager, select  “Advanced Settings” and inside that, on the 2nd row, will be the option to turn on 32 bit applications.
  15. Download and install MSVC runtime 2012 (yes, 2012 this time) — it is needed for 32 bit PHP-CGI.
    1. Edit 12-07-2015: If using PHP 7.x, download and install MSVC runtime 2015 and use the version of PHP 7.0 that is compiled for 32 bit on MSVC runtime 2015 (they have versions for the other MSVC runtime as well, but the latest runtime is always recommended.)
  16. Download and install URL Rewrite for IIS.
  17. Make sure your DNS settings are set for your server’s IP.
  18. Create a certificate request for an SSL certificate. Use the request to purchase an SSL certificate and install it.
  19. Setup IIS bindings for your domain name to point to your IIS Website.
    1. Make sure you set up bindings for http://www.mydomain.com and just http://mydomain.com
    2. Set up bindings for https://www.mydomain.com and https://mydomain.com
      1. When doing this, make sure  you check the SNI checkbox.

Part 2 — Install WordPress

  1. Go to your WordPress folder and copy the wp-config-sample.php file to a new file named wp-config.php.
  2. Edit your new wp-config.php so that it has the database name and password. You will see the sample entries in there already, so just replace them with your values.
    1. The database name is the schema you created in Part 1 above.
    2. The user name and password is for the admin user you created in Part 1 above.
  3. Create new secret salt keys — there is a section in wp-config.php that is clearly labeled and includes directions to a website that will automatically generate strong random salts for you.
  4. At this point you should be all set to start the installation of WordPress. Assuming your IIS webserver has been started and your DNS settings have propagated, you should be able to point your web browser to your website domain WordPress installation URL:  http://www.yourdomain.com/install.php.
    1. This is your “5 min” install. It probably took you two or three hours just to get to this point. But once here, it’s just five minutes!

At this point, your new WordPress sites should be up and running. You can navigate to http://www.yourdomain.com/wp-admin to get to the administration login page.

If you have read this far, you might also be interested in the next article — Enabling Multisite For WordPress on Windows and IIS

 

Comments 0