THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Davide Mauri

A place for my thoughts and experiences the Microsoft Data Platform

Wordpress Installation (on IIS and SQL Server)

To proceed with the installation of Wordpress on SQL Server and IIS, first of all, you need to do the following steps

  1. Create a database on SQL Server that will be used by Wordpress
  2. Create login that can access to the just created database and put the user into ddladmin, db_datareader, db_datawriter roles
  3. Download and unpack Wordpress 3.3.2 (latest version as of 27 May 2012) zip file into a directory of your choice
  4. Download the wp-db-abstraction 1.1.4 (latest version as of 27 May 2012) plugin from wordpress.org website

Now that the basic action has been done, you can start to setup and configure your Wordpress installation.

Unpack and follow the instructions in the README.TXT file to install the Database Abstraction Layer. Mainly you have to:

  • Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins.  This should be parallel to your regular plugins directory.  If the mu-plugins directory does not exist, you must create it.
  • Put the db.php file from inside the wp-db-abstraction.php directory to wp-content/db.php

Now you can create an application pool in IIS like the following one

image

Create a website, using the above Application Pool, that points to the folder where you unpacked Wordpress files.

Be sure to give the “Write” permission to the IIS account, as pointed out in this (old, but still quite valid) installation manual:

http://wordpress.visitmix.com/development/installing-wordpress-on-sql-server#iis

Now you’re ready to go. Point your browser to the configured website and the Wordpress installation screen will be there for you.

When you’re requested to enter information to connect to MySQL database, simply skip that page, leaving the default values. If you have installed the Database Abstraction Layer, another database installation screen will appear after the one used by MySQL, and here you can enter the configuration information needed to connect to SQL Server.

After having finished the installation steps, you should be able to access and navigate your wordpress site.  A final touch, and it’s done: just add the needed rewrite rules

http://wordpress.visitmix.com/development/installing-wordpress-on-sql-server#urlrewrite

and that’s it!

Smile

Well. Not really. Unfortunately the current (as of 27 May 2012) version of the Database Abstraction Layer (1.1.4) has some bugs. Luckily they can be quickly fixed:

Backslash Fix
http://wordpress.org/support/topic/plugin-wp-db-abstraction-fix-problems-with-backslash-usage

Select Top 0 Fix
Make the change to the file “.\wp-content\mu-plugins\wp-db-abstraction\translations\sqlsrv\translations.php” suggested by “debettap” Winking smile  http://sourceforge.net/tracker/?func=detail&aid=3485384&group_id=315685&atid=1328061

And now you have a 100% working Wordpress installation on SQL Server!

Since I also wanted to take advantage of SQL Server Full Text Search, I’ve created a very simple wordpress plugin to setup full-text search and to use it as website search engine:

http://wpfts.codeplex.com/

Enjoy!

Published Sunday, May 27, 2012 5:14 PM by Davide Mauri
Filed under: , , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Davide Mauri said:

In the last months, in the spare time, I started to study PHP in order to use it on a Windows + SQL Server

May 27, 2012 10:15 AM
 

Brent Ozar said:

WOW!  Things have gotten a lot easier since I tried to pull this off a few years ago.  Nice to see!

June 6, 2012 1:45 PM
 

Matthew Blott said:

Thanks, this was very useful. The only thing I would add is the user will need to put the appropriate extension in their PHP extensions folder - php_pdo_sqlsrv_52_nts_vc6.dll - in my case (this isn't overly obvious).

One other thing - the "Select Top 0 Fix" link seems to point to something different (unless I am missing something). I've just installed this and aim to migrate our existing Wordpress sites across to SQL Server and don't want to do so if there are any bugs I've  missed.

Thanks again,

Matt

July 31, 2012 7:12 AM
 

Matthew Blott said:

My apologies - just read the second link and it's all there! Note to self - read things properly :-)

July 31, 2012 7:14 AM
 

rick watson said:

anyone gotten this to work with wordpress 3.4?

November 8, 2012 11:01 AM
 

Patrick said:

There's a new solution to this problem.  WordPress has been forked to run natively on SQL Server 2012 and SQL Azure.  Http://ProjectNami.org

June 18, 2013 8:52 AM
 

Davide Mauri said:

Patrik, that's GREAT!

July 8, 2013 1:47 AM

Leave a Comment

(required) 
(required) 
Submit

About Davide Mauri

Director of Software Development & Cloud Infrastructure @ Sensoria, an innovative smart garments and wearable company. After more than 15 year playing with the Microsoft Data Platform, with a specific focus on High Performance databases, Business Intelligence, Data Science and Data Architectures, he's now applying all his skills to IoT, defining architectures to crunch numbers, create nice user experiences and provide meaningful insights, all leveraging Microsoft Azure cloud. MVP on Data Platform since 2006 he has a very strong background development and love both the ER model and OO principles. He is also a fan of Agile Methodology and Automation, which he tries to apply everywhere he can, to make sure that "people think, machines do".

This Blog

Syndication

Privacy Statement