Date:October 29, 2015
A Comprehensive Guide to Installing WordPress on Windows and IIS
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:
- You have a brand new installation of Windows Server 2012, fully patched and IIS 7.5 or later installed.
- Your attempt to use the WebMatrix tool to install WordPress has failed with no good explanation, so you will be installing everything manually.
- 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
- If you have tried using WebMatrix to install WordPress and were unsuccessful, you should uninstall MySQL using the Add/Remove programs control panel.
- Download the latest version of WordPress from this page.
- Create a folder and unzip the files from the download. This folder will be your primary WordPress folder.
- 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).
- 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.
- Download and install MySQL (either community edition or a commercial edition).
- During the installation on MySQL, you might be asked to download additional prerequisite software, so be prepared to do that.
- Download and install the MSVC 2013 Redistributable (search for it on the Microsoft Web Site). This is needed for the next item.
- Download and install MySQL Workbench.
- Using the MySQL WorkBench software, connect to your local MySQL install, create a new user, and give them full administrative rights.
- Make sure you use a STRONG password.
- Create a new Schema in MySQL using the MySQL WorkBench software.
- Grant rights to the user created in 6 above to the new schema you just created.
- Download and install PHP for Windows.
- Download and install PHP Manager for IIS.
- Go To IIS Manager, open up PHP Manager and let it do its “check”. Allow it to fix all errors EXCEPT the “Document” error.
- 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.
- Create a new website in IIS Manager, and point it to your WordPress folder (x:\wordpress\CompanyOrAppName\).
- 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.
- Turn on 32 Bit Apps for your Website since PHP is a 32 bit application.
- 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.
- Download and install MSVC runtime 2012 (yes, 2012 this time) — it is needed for 32 bit PHP-CGI.
- 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.)
- Download and install URL Rewrite for IIS.
- Make sure your DNS settings are set for your server’s IP.
- Create a certificate request for an SSL certificate. Use the request to purchase an SSL certificate and install it.
- Setup IIS bindings for your domain name to point to your IIS Website.
- Make sure you set up bindings for http://www.mydomain.com and just http://mydomain.com
- Set up bindings for https://www.mydomain.com and https://mydomain.com
- When doing this, make sure you check the SNI checkbox.
Part 2 — Install WordPress
- Go to your WordPress folder and copy the wp-config-sample.php file to a new file named wp-config.php.
- 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.
- The database name is the schema you created in Part 1 above.
- The user name and password is for the admin user you created in Part 1 above.
- 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.
- 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.
- 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