Debriefing
We’re a Windows shop here. So when the topic came up from our Application Developer to test out WordPress as the platform for our next website we knew that it would be the unconventional approach to doing things. But, I’m always up for the challenge. Since I could find no concise guide to getting this done I figured I’d share my approach with you all to ease some of the pain.
The Environment
- The server is a VM running Windows Server 2008 R2 which is of course 64-bit. This is now the standard O/S platform for all newly created servers in our environment.
- The database server will not be SQL Server Express as we have a VM running SQL Server 2008 SP1 in our environment. This guide is written for those who have this setup as most of the guides that you find around the web assume that installing SQL Server Express locally is acceptable.
- Keep in mind that this installation is intended for a development environment and not for production. It’s safe to assume that additional security measures will need to be taken before employing IIS, WordPress or any of the other components in a production environment.
Install IIS 7.5
The first step in the process is to install the web server–IIS 7.5. The configuration options that we select will take into account that we will later need to install PHP, WordPress and other components on the server.
- Open Server Manager. Click Roles, then Add Roles.
- In the Add Roles Wizard click Next to skip past the first screen. At the Server Roles step select Web Server (IIS). Click Next, then Next again past the introduction.
- At the Role Servicesstep select the following keeping the default selections in tact:
- HTTP Redirection
- Application Development (the entire node)
- Basic Authentication
- Windows Authentication
- Digest Authentication
- Click Next then Install.
- Once installation is complete close Server Manager and re-open again to refresh it (just a little something I do out of habit because sometimes Server Manager doesn’t update like it ought to).
- In Server Manager go to Roles > Web Server (IIS) > Internet Information Services (IIS) Manager. I usually click the Show/Hide Console Tree button at this point.
- Within IIS Manager select the Server > Application Pools. Select Set Application Pool Defaults from the Actions pane on the right.
- Change Enable 32-bit Applications to True. This is important as there is no stable release of PHP that runs on a 64-bit Windows O/S.
Install PHP 5.3.5 for Windows
Next we need to install PHP 5.3.5 for Windows. We want to use FastCGI for its performance advantages. So this process will enable this functionality in our environment.
Download and Install PHP Manager
- Go here: http://phpmanager.codeplex.com/ to download PHP Manager. Be sure to download and install the x64-bit edition.
Download and Install PHP 5.3.5 for Windows
- Go here: http://windows.php.net/download/. Under VC9 x86 Non Thread Safe, select the Installer since this is a fresh installation of PHP; to download.
- Run the Setup Wizard hitting Next at the first screen and accept the EULA.
- Change the installation directory to C:\PHP-5.3.5 so as to provide flexibility if you wish to run multiple versions of PHP on the same server.
- At the Web Server Setup step select IIS FastCGI.
- (Optional) – Install the following features: Script Executable, Register *.php files to open automatically and PEAR Install.
- Click Next then Install to complete setup.
Configure PHP 5.3.5 Using PHP Manager
- Go to IIS Manager and select PHP Manager.
- Under PHP Setup select View Recommendations.
- Select all of the recommendations and hit the OK button.
- (Optional) – Select PHP Error Reporting and select Development Machine and change the location of the error logs.
Install a Few Additional Components
Now with PHP installed there are a few recommended additional components that need to be downloaded and installed.
Download and Install URL Rewrite
- Go here: http://www.iis.net/download/urlrewrite and download the x64-edition of the URL Rewrite Module 2.0.
Download and Extract SQL Server Driver for PHP 1.1
- Go here: http://bit.ly/dYe5W2 to download the executable.
- When prompted for a location to place the extracted files browse to C:\PHP-5.3.5\ext which is the PHP extensions folder.
Import Extensions into PHP Using PHP Manager
- Go into PHP Manager and select Enable or Disable an Extension.
- Select php_sqlsrv_53_nts_vc9.dll and click Enable in the Actions pane. This allows for PHP to communicate with a SQL Server database.
The Time Has Come to Install WordPress!
Finally, we’ve arrived at the point where we install WordPress. There are a few things that need to be done within IIS and with folder permissions but this should be the easy part.
Prepare IIS for the WordPress Install
- Go into IIS Manager and stop the Default Website as I wish to install WordPress in its own folder.
- Go to the C:\inetpub\wwwroot folder and create a folder called wp-sqlsrv.
- Right-click on the folder and select Properties.
- Go to the Security tab and grant the local IUSR account Write access to the folder.
- Back in IIS Manager Add a Website called wordpress (or whatever you’d like to name it) with the Physical Path pointing to the folder that we just created.
- In the Bindings section create any IP Address, port or host name bindings that are appropriate for your environment. I just entered the host name of the server for starters.
- Creating this website creates an application pool of the same name. Go into Application Pools and select the wordpress application pool.
- Select Advanced Settings and under Identity select Custom account. I enter the username and password of an account with domain admin rights just for the installation of WordPress. I will change this back post-installation.
Prepare SQL Server 2008 for the WordPress Install
- Launch the SQL Server 2008 Management Studio and connect to the database server in your environment.
- Go to Security > Logins and create a New Login (something like wpuser).
- Select SQL Server Authentication and decheck Enforce password expiration.
- Leave everything else as the default and click the OK button.
- Go to Databases and create a database called wordpress (or whatever you desire) and make the user that we just created (e.g. wpuser) the Owner of the database.
Download and Install the SQL Server Native Client
- Go here: http://www.microsoft.com/web/downloads/platform.aspx to install the Web Platform Installer.
- Search for SQL Server Native Client and Install.
Download and Install WordPress on SQL Server
- Go here: http://wordpress.org/extend/plugins/wordpress-database-abstraction/ and download the WP Database Abstraction Plugin. Please be sure to read the Other Notes section before using this plugin as there are limitations and things that you will need to be aware of when it comes to the abstraction plugin interacting with other plugins.
- Extract the .zip files to the root of the C:\ drive then copy the contents of the wordpress folder to C:\inetpub\wwwroot\wp-sqlsvr.
- While in the root of the wp-sqlsvr folder create a web.config file with the following contents:
<?xmlversion="1.0"encoding="UTF-8"?><configuration><system.webServer><httpErrorserrorMode="Detailed"/></system.webServer></configuration> - Browse to the website and select Create a Configuration File.
- Go through the configuration wizard for WordPress setup and be sure for Database Type to select SQL Server using MS PHP Driver.
- When you are finished setting WordPress up and the initial site launches, change the web.configfile to this to activate URL rewrite:
<?xmlversion="1.0"encoding="UTF-8"?><configuration><system.webServer><rewrite><rules><rulename="wordpress"patternSyntax="Wildcard"><matchurl="*"/><conditions><addinput="{REQUEST_FILENAME}"matchType="IsFile"negate="true"/><addinput="{REQUEST_FILENAME}"matchType="IsDirectory"negate="true"/></conditions><actiontype="Rewrite"url="index.php"/></rule></rules></rewrite></system.webServer></configuration>
It’s A Wrap
That should do it. The database should configure itself and you’ll be prompted to enter the admin account username and password for WordPress and that should be all that is needed. I hope this concise guide was helpful.



We are evaluating this as a possible solution. How is the solution working out for you so far? Your instructions are very well presented, and very appreciated!
I’ve added a few Secondary Sites with Windows Server 2008 R2 installed using this process and they are functioning just fine. Good luck.
Hi, I am trying to follow this tutorial and I get to the part where I am using the wordpress configuration wizard and it does not offer SQL Server using MS PHP Driver as an option for Database Type. I’ve followed all the other steps and I’d appreciate any advice. The only thing I can imagine that may be the problem is that my wordpress is not installed on C:\inetpub\wwwroot\wp-sqlsvr but on the D drive in a subfolder for a specific website eg D:\Sites\SiteX\myblog (I have several websites hosted through IIS7 on the D drive and the wordpress blog is intended for a specific one.)
Thank you very much.
Sounds like you may have forgotten to download and install the SQL Server Native Client? I remember having this problem as well. Double-check and make sure you didn’t leave out this step.
Do you think this would work on a wordpress virtual appliance that is hosted on the same ESXi server? I have a 2008 R2 server that is running IIS and has my main site on it. It is an ESX VM image and then on the same ESX server I have a wordpress virtual appliance that i am trying to set up (Bitnami). I can get it to work internally but I would like to mount it to my IIS web server or have it redirect to my wordpress site. something like http://www.mydomain.com/blog. Is there an easy way to do this. I tried to do it as a virtual application but is says that the files do not exist on the server I put in. I tried putting it in as http://192.168.1.43/wordpress. Any suggestions?
When you say “internally” you mean that the WordPress virtual appliance is not accessible on the Internet?
Sorta. I tried to put in a child domain from my main site. blog.mckillopinc.com:81/wordpress from my godaddy account with port 81 on my firewall going to my port 80 on my wordpress but it does not seem to be working. I only have a single IP address and am trying to tie all this together through my main IIS server if I can. I am not even sure that this can be done this way. Any help and advice is appreciated.
James
Is there any change you can update this tutorial? I’ve been trying to do it for a few days now, but haven’t been successful. The distribution no longer comes ready. One has to apply the plug in.
I think I’ve done everything right, but at the moment of initial site setup, my only options are MySQL, MySQLi, and PDO MySQL. I do not see the option for SQL
Can you please advide?
Ok. I will go through the steps again on a fresh install of Windows Server 2008 R2 and update the post if I encounter any issues.
By the way, I know I have the SQL native client installed. Administrative tools > Data resources > Drivers > SLQ Server Native Client 10.0
Hi, just wondering if you have sucessfuly got the network setup / plugin working on a SQL database? We’ve WordPress 3.31 working on SQL, however we want all of the students to have their own blog using the network setup. After installing the Network setup, we can’t get back to the login screen. Any tips appreciated.
Have never tried this. Sorry for the late reply but any update on how this worked out for you (or didn’t)?
I have been following your great instructions, but when I get to the Download and Install WordPress on SQL Server step, the download from http://wordpress.visitmix.com/download doesn’t seem to have any files. I am assuming that it may have been replaced by the DB Abstraction plugin, but am now confused on how to proceed. Any help you can provide would be greatly appreciated.
Thanks for the update. Yes, it appears as though they have moved the abstraction plugin elsewhere. I have updated the post with the new link. Let me know how things come out.
Hi, i have been following all steps but i have a problem, when i install wordpress doesn´t have the option to choose the DB. The only step i can´t follow is download sql native client, this doesn´t appears in the web installer. but i was checking and saw i have SQL Native Client 10.0 . What could be the problem? Some advice?
Thanks!!!!
[...] components running on familiar Microsoft applications (IIS 7.5 & SQL Server 2008 R2). I found this article explaining how to do it. However, after further research I confirmed that the only [...]
Baroni, checked out the updated link for WP Database Abstraction Plugin. Thanks for that! Being a SQL guy I will be much more comfortable managing the database using SSMS.
Followed this guide and had everything working, except when I went to post. the posts never show up. I can see them with direct links, but somethings not right. No errors show up in php or other logs either. I ended up just going with the webmatrix packaged install and it works fine, i just hate running two databases.
hello
Is it possible to configure wordpress with sql server 2005.
I have a WordPress on IIS 7.5, SQL2008R2 setup. I have set my pretty permalinks, and then set the web.config to read-only. The pretty permalinks work correctly. I do however get a ‘The FastCGI process exited unexpectedly’
error when I try and enter the options-permalink.php page. If I refresh the page a couple of times the page displays correctly though. Any idea’s what causes this, perhaps the fact that the web.config is readonly and cannot be changed? I also was wondering if there are any incompatibility problems with any popular plugins and SQL Server?
Hi, great post. i’m getting to /wp-content/mu-plugins/wp-db-abstraction/setup-config.php?step=1 where is asks for the connection details. My SQL server is separate from the IIS server running WordPress. I’m filling in the details on the page /wp-content/mu-plugins/wp-db-abstraction/setup-config.php?step=1 but it’s saying it can’t find the database. Is there something specific i need to setup on the server running SQL 2008R2 ? You mention in your post, “Browse to the website and select Create a Configuration File.”. if i browse the website, there is no option to select SQL Server, it assumes you’re installing on MYSQL and no other connection type is offered.
It took me a while to get all the issues I encountered in the setup finally ironed out… I believe the “gotcha” that is causing the setup script to be unable to find the database is due to a default SQL Server configuration setting. The network config setting (found in the SQL Server Configuration Manager under SQL Server Network Configuration) defaults to only “Shared Memory” being enabled. I think the server is making a TCP/IP connected to the database server… but I enabled both the TCP/IP and Named Pipes protocols.
For anyone else setting out to get WP running under SQL Server, I think a much easier way to install PHP 5.3, PHP Manager, the MS Drivers for PHP, SQL Server Native client and URL Rewrite 2.0 is by using the Microsoft Web Platform Installer (http://www.microsoft.com/web/downloads/platform.aspx). Just a few button clicks to get all of this loaded without fussing over separate downloads, manual installation, adjusting config files. Going this route, make sure to go into the PHP Manager (in the IIS Manager) and accept the “Recommended Changes”. This is important as one of the changes is mapping to the correct version of php.ini (that is, the one just installed).
WordPress is working fine for me, except for the same problems posted by ravetroll!
I tried everything to fix permalinks, without success: many PHP versions from 5.3 to 5.4, many SQL Server versions, from Std 2008 R2 to 2012 Express… issue is still there.
Latest version of DB Abstraction plugin (1.1.4) is broken: I left a post on the official support forum (see http://wordpress.org/support/topic/wp-db-abstraction-broken?replies=2 ) but no answer so far, I’m still with 1.1.3
I don’t know if the problem is related to SQL Server, I will try soon a separate MySQL installation for a separate test.
500.0 error is generic and does not help debugging…
Quoting myself…
I created a test environment from the scratch, then I installed WordPress by using Web Platform Installer on MySQL database. No permalink issue.
Then, I installed SQL Server Express 2012, deleted wp-config.php, installed the WP DB Abstraction plugin and re-configured WP site. The permalink issue was there! Tried 1.1.4, 1.1.3. 1.1.2 versions of the plugin… all the same.
The issue seems to be related to DB Abstraction plugin… I will post in its forum, hoping the authors will reply this time.
Solved! The issued seem to be caused by deprecated mssql driver, that “doesn’t understand unicode and other features” (as plugin authors say). Switching to pdo-mssql driver permalink issue seems to be solved, and other issues I was not aware of, I think.
However, plugin 1.1.4 is broken also with pdo-mssql driver…
I’m a bit confused… are you saying that you got further with the pdo-mssql abstraction class, but in the end it still is broken? I tried enabling only the pdo-mssql extension but still encounter the permalinks not showing.
(@Michael M – I keep replying to myself because in your post the “reply” link is missing
)
Sorry for the confusion.
I meant that permalink issue seems to be solved switching to pdo_mssql driver, from DB Abstraction plugin up to version 1.1.3, but version 1.1.4 has more problems with both mssql driver and pdo_mssql driver.
My question in wordpress.org plugin support site about the latest version (1.1.4) did not never receive an answer so i keep using 1.1.3:
http://wordpress.org/support/topic/wp-db-abstraction-broken?replies=3
Hi
Nice post-thanks
I’m looking for help with my Win7/WordPress IIS7.5 WordPress auto update.
On trying to auto update WP to the latest version at the moment I get error”Unable to locate WordPress Content directory (wp-content).Installation Failed”
Do you have any experience or idea how I fix this? Grateful for any help-thanks
I never would have thought how much stuff you could find on the internet about this!
Thank you for making this all easy to get
it
Hi, Thanks for the post, I’m using a managed host but still found your post useful. I got to the point where it created my admin account and then I got this error;
Call to undefined function mysql_free_result() in E:\kunden\homepages\19\d343921438\www\wordpressbuild\wp-includes\wp-db.php on line 1122
Any ideas what might be going on?
Thanks
Edit the wp-db.php file and comment out the if block starting at line 1121:
//if ( is_resource( $this->result ) )
//mysql_free_result( $this->result );
That should allow you to complete the install on a 1and1 hosted site.
Spot on! Thanks for that.. Only just got round to trying your suggestion and it worked.
I’m good all the way up to where after you’ve created the web.config file, you say, Browse to the website and select Create a Configuration File. If I browse the website thru IIS, I get a HTTP Error 500.19 – Internal Server Error, and likely causes:
•The worker process is unable to read the applicationhost.config or web.config file.
•There is malformed XML in the applicationhost.config or web.config file.
•The server cannot access the applicationhost.config or web.config file because of incorrect NTFS permissions
So, I’m stuck at this point. Thanks for any assistance.
Fastidious response in return of this difficulty with solid arguments
and describing the whole thing regarding that.
Hi,
I followed all steps. There is a missing step where the wordpress abstraction plugin files need to be copied inside mu-plugins folder inside the wp-content folder. After that the setup-config.php file the one to be used that is located inside the abstraction folder.
I made sure the SQL Server user can login to the DB, I am getting error when I hit Submit configuring the wordpress database.
…
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at WIN7\SQLSERVER2008R2. This could mean your host’s database server is down.
…
I am installing wordpress over SQL Server 2008 R2 on a testing machine running Win 7.
Any idea where I can locate error logs to find out why it is not working?
Thanks
Howdy! Do you know if they make any plugins to assist with Search Engine Optimization?
I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
If you know of any please share. Appreciate it!
I’ve been on the internet now for nearly six today, and after I happened upon wordpress.com on http://techsugar.wordpress.com/2011/03/02/how-to-install-wordpress-on-iis-7-5-using-sql-server-2008/, I was very pleased to.. In my view, if all web site entrepreneurs and bloggers developed excellent information as you have, the web will be a lot more advantageous than at any time before.
Denn auf unserem Geschenke des weiteren Geschenkideen
Blog präsentieren unsereins schöne Dinge und Wohnkamine.
Wir ziehen umher und sehen kontinuierlich mal was uns sehr gefällt und
das präsentieren wir hier. Freilich können Sie die meisten
Produkte auch sofort kaufen, aber ausschließlich per amazon, damit ihr Einkauf sicher ist!