Writings

Installing WordPress on SQL Server

Before you read this article, please note: the easiest way to install WordPress on SQL Server or SQL Azure is to use the Getting Started page. If you’re still having trouble or want more details, read on!

These instructions assume you’re installing WordPress on Windows 7 or Windows Server 2008 or 2008 R2. If you’re installing WordPress in a Windows share hosting environment, many of these same concepts apply.

Here’s a summary of the steps:

  1. Install the Prerequisites
  2. Configure a Database
  3. Download the WordPress on SQL Server Distribution
  4. Configure IIS
  5. Install WordPress
  6. Remove IIS Detailed Errors and Configure URL Rewrite

1. Install the Prerequisites

Use the Microsoft Web Platform Installer. Be sure you have:

  • II7 or above (Windows Vista, Windows 7, Windows Server 2008, Windows Server 2008 R2)
  • PHP 5.2 or above
  • SQL Server Express 2008 w/Tools or above
  • PHP Driver for SQL Server v1.1 or above
  • URL Rewrite 2.0 or above

Get Products with Web Platform Installer

Click here to install all these products with the Web Platform Installer.image

Click on the Get the Microsoft Web Platform button and accept the prompts to install WPI.

image

Click on the bar at the top of the browser to install the add-on.

image

Follow the onscreen prompts and grant permission for the site to open WPI.

image

image

Once the Web Platform Installer downloads and installs all the prerequisites, it will prompt you to configure your SQL Server Express install.

image

Choosing Mixed Mode Authentication and providing an (sa) password will make your web development easiest.

The Web Platform Installer will now download all the bits and prerequisites.

image

Once the download is complete, it will automatically install and configure the software.

image

image

Now you’re ready to run web applications on the Microsoft Web Platform.

2. Configure a Database

In this step, you’ll create a database and a database user for your WordPress install.

Start by running SQL Server Management Studio from your start menu.

image

You’ll be prompted to log on to SQL Server.

image

Connect to your database using Windows Authentication and .SQLExpress for the Server name.

image

Create a new database Login by expanding the Security. Right click on Logins to select New Login.

image

Supply a Login name; select SQL Server authentication; provide a Password and uncheck User must change password at next login. You can leave the rest of the defaults.

Now you need to create a database.

image

Create a new Database by right clicking on Databases to select New Database.

image

Enter a Database name and specify the Login name of the user you created above.

Now you’re ready to proceed with the WordPress install.

3. Download the WordPress on SQL Server Distribution

Go to the Download page and select the standard or Multi-User Distribution from the box on the right side of the page.

image

This will take you to the SourceForge download page for the current version.

image

If you try to save the ZIP file directly to your IIS directory, you’ll probably get a permissions error like below.

image

Save the ZIP somewhere else on your machine, extract the files and copy them into the C:inetpubwwwrootwp-sqlsrv folder.

image

image

image

4. Configure IIS

The most common issue I’ve discovered involves WordPress’ use of HTTP errors.

Enable IIS Detailed Error Messages

When trying to install WordPress for the first time,you might get an IIS 500—an internal server error that says,“There is a problem with the resource you are looking for, and it cannot be displayed”.

image

WordPress is designed to throw an HTTP 500 error if a wp-config.php file is not detected. The problem is that the default install of IIS 7 is overriding HTTP errors for external users as to now show detailed information about the server.

You can temporarily override this behavior during the installation process by telling IIS to show Detailed errors. Do this by creating a web.config file in the root of your WordPress install with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed"/>
    </system.webServer>
</configuration>

Grant IIS Write Permissions to WordPress Folder

Next, you need to ensure your IIS has write permissions to your WordPress installation folder. 

NOTE: If IIS does not have write permissions to your WordPress folder you will get caught in a loop where you enter your database credentials then get taken back to the initial installation screen. 

By default IIS runs as IUSR so you must add this user with Write permission through Windows Explorer.  Browse to the installation folder, right click on the wp-sqlsrv folder and select the Security tab.

image

Click the Edit button, select Add, then type IUSR for Enter the object names to select.  Click on Check Names and IUSR should now be underlined. 

image

When you click OK the top window will close.  Make sure to give this user Write permissions by selecting the checkbox.

image

5. Install WordPress on SQL Server

Browse to the root of your WordPress install, which in my case is http://localhost/wp-sqlsrv/.

image

Follow the prompts until you’re asked for database information.

image

Specify the Database Name, User Name and Password you created while configuring the database. For the default SQL Server Express install, you will enter .SQLExpress for the Database Host.

Select the sqlsrv driver for Database Type. This will use the PHP Driver for SQL Server, which was developed and maintained by the SQL Server team.

You should see the screen below, with an option to Run the install.

image

If you don’t see this screen and are taken back to the first screen of the install, that means your web server doesn’t have permission to write to the directory (See step 4).

image

You can get information on IIS security here.

If the install is moving forward, you’ll just need to enter your blog information and receive the admin password.

image

Now WordPress should be up and running on SQL Server!

image

The last step is to update your web.config to remove the IIS Detailed errors and enable URL Rewrite.

6. Remove IIS Detailed Errors and Configure URL Rewrite

Remove detailed IIS error messages and add URL Rewrite rules by replacing the contents of your web.config with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="wordpress" patternSyntax="Wildcard">
                    <match url="*"/>
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
                    </conditions>
                    <action type="Rewrite" url="index.php"/>
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Now enjoy using WordPress on SQL Server!

For Support

If you’re still having issues, please using the WordPress on SQL Server forums on SourceForge.

Comments 465 Comments - Join the conversation

  1. Brandy says:

    Thanks to my father who told me about this blog, this blog is actually remarkable.

  2. Hi there i am kavin, its my first occasion to commenting anyplace, when i read this article i thought i could also create comment due to this brilliant
    piece of writing.

    Here is my web blog; Microsoft Office 2011 Free Download; http://Www.mojduniya.com/forum/Profile.php?id=251390,

  3. Kandi says:

    Amazing blog! Is your theme custom made or did you download it from somewhere?
    A theme like yours with a few simple tweeks would really make my blog shine.
    Please let me know where you got your design. Kudos

  4. I loved as much as you’ll receive carried out right here. The sketch
    is attractive, your authored subject matter stylish.
    nonetheless, you command get bought an edginess over that you wish
    be delivering the following. unwell unquestionably come more formerly
    again as exactly the same nearly a lot often inside case you shield
    this increase.

  5. Howdy, i read your blog occasionally and i own a
    similar one and i was just wondering if you get a lot of spam responses?
    If so how do you stop it, any plugin or anything you can recommend?
    I get so much lately it’s driving me mad so any help is very much appreciated.

  6. What i don’t realize is if truth be told how you’re no loner
    actually much more neatly-liked than you
    may be now. You’re very intelligent. You understand therefore significantly on thhe subject of this subject, producedd me
    in myy opinion imagine itt from a lot of numerous angles.Its
    like women and men aren’t interested until it’s oone
    thing to accomplish with Laady gaga! Youur oown stuffs great.
    Always maintain it up!

    Also visit my blog – lipo g3 garcinia Cambogia cleanse

  7. Its like you read my mind! You seem to know so
    much about this, like you wrote the book in it or something.

    I think that you could do with a few pics to drive
    the message home a little bit, but instead of that, this is
    fantastic blog. An excellent read. I will certainly be back.

    my blog: explainer video cut outs

  8. Le site « Juste Une Maison » permet à tout à chacun, particuliers comme professionnels, de disposer de leur page personnalisée pour une somme modeste minimale de 1€.

  9. Last but not least appeared around the cabinets!
    PwnCheats is usually very happy to launch the one Net Jello Splash over Cheats.
    You’ll be able to come up with and have absolutely a much better credit score after that anyone else on this Jelly Sprinkle Tricks.
    Do people at any time find stuck using a levels which in turn needed all your lifestyles out?
    This particular would not occur ever again because you can certainly replace
    ones lifestyles at any time. Even though you possess 1 life
    quit, permit this excellent Jelly Splash Tips creator make people some
    more. Find the best rating amongst your mates along with enable them speculate
    and also attempt defeat the higher ranking. You’ll need much more encounter to end an even?
    Not an issue throughout only two ticks it is possible
    to build more exp. What exactly are you anticipating, The actual Jello Dash Be unfaithful is waiting so
    that you can generate.

  10. Its like you read my mind! You appear to know so much about this, like you wrote the book in
    it or something. I think that you can do with a few pics to
    drive the message home a little bit, but
    other than that, this is magnificent blog. An excellent read.
    I will certainly be back.

  11. Hello there I am so glad I found your website, I really found you by error, while I
    was searching on Aol for something else, Anyhow
    I am here now and would just like to say
    many thanks for a tremendous post and a all round interesting blog (I also love the theme/design), I don’t have time
    to read it all at the minute but I have book-marked
    it and also added in your RSS feeds, so when I have time I will be back to read a lot
    more, Please do keep up the great work.

    Feel free to visit my site – get free microsoft points

  12. wonderful points altogether, you simply won a new reader.
    What may you suggest in regards to your publish that
    you just made a few days in the past? Any certain?

  13. My spouse and I stumbled over here by a different page and thought I might check
    things out. I like what I see so now i’m following
    you. Look forward to looking into your web page repeatedly.

  14. Hello there! This is kind of off topic but I need some guidance from an established blog.
    Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty
    fast. I’m thinking about making my own but I’m not sure where to begin.
    Do you have any tips or suggestions? Many thanks

    Also visit my web site – Brave Frontier Hack Tool

  15. Get more helpful and tried-and-tested ASVAB test study guide tips.
    I felt that I shouldn’t give on my dreams, so I worked hard and applied to
    jobs. If you are already studying for the SAT or ACT math and verbal, this same material is what is tested on the ASVAB math and verbal.

Add a Comment