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 238 Comments - Join the conversation

  1. louis vuitton ?????? ??

  2. ?? ???? ?? says:

    louis vuitton ?? ??????

  3. ??? ???? says:

    >??? louis vuitton

  4. ??? ?? ???? says:

    louis vuitton ?? ??????

  5. ???? ?? ?? says:

    louis vuitton ??

  6. ?? ???? ??? says:

    louis vuitton ??? ??????

  7. ?? ???? ?? says:

    louis vuitton ????

  8. louis vuitton matelasse

  9. ??? ??,louis vuitton ??

  10. louis vuitton e store

  11. What i do not realize is actually how you are now not really much more well-appreciated than you may be now.
    You”re so intelligent. You recognize thus considerably in terms of this topic, made me individually consider it from a lot of various angles. Its like men and women aren”t
    interested until it is one thing to accomplish with Lady gaga!
    Your personal stuffs outstanding. Always take care of it up!

  12. Whats up folks, i”m a bit of a watch junkie. Hi everyone I had been discovering this site and I genuinely cherished it. It includes quite a few truly nice insights for me to digest. I have got to mention, I”ve been unhappy most recently since my brother no longer is here with
    me. Exploring the net provides me with a small amount of piece of mind though.

    I”d love to thank you due to this superb internet content which probably can help send out the message when it comes to watches even more! I really was curious as to if you currently have an e-mail opt-in list so I can keep current on this website.

  13. David French says:

    Hello,

    Thanks for the great instructions. Everything works great when setting up the base install. As soon as I copy in my theme (purchased from themeforest) into the site and dies with the below error message:

    HTTP Error 500.0 – Internal Server Error
    C:Program Files (x86)PHPv5.3php-cgi.exe – The FastCGI process exited unexpectedly

    Module FastCgiModule
    Notification ExecuteRequestHandler
    Handler PHP53_via_FastCGI
    Error Code 0x000000ff

    Requested URL …../wp-admin/customize.php?theme=care
    Physical Path ……/wp-admincustomize.php
    Logon Method Anonymous
    Logon User Anonymous

    I”ve tried searching the web for resolution and I”ve been unable to determine what is causing this error. As soon as I delete the theme from the site, everything goes back to working. I”ve successfully activated some simple plugins with no issues. I have a clone of the website working with MySQL instead of SQL without issue using the same exact theme.

    Thoughts or suggestions?

    I”ve installed SQL Server drivers into the PHP ext folder (and enabled them in IIS PHP Manager). I installed ASP Extensibility amoung several other things I found on the web, still the error persists.

    Thanks,
    Dave

  14. Hello, i think that i saw you visited my site thus i came to
    “return the favor”.I’m attempting to find things to enhance my web site!I suppose its ok to use a few of your ideas!!

  15. Mitch says:

    What i do not realize is in fact how you are not really a lot
    more neatly-appreciated than you may be right now.
    You are very intelligent. You realize thus significantly in the case of this matter, produced me
    for my part consider it from a lot of numerous angles.
    Its like men and women are not fascinated except it’s something to do with Lady gaga! Your individual stuffs great. All the time maintain it up!

    My site streaming service (Mitch)

  16. Sheila says:

    Sold conveniently everywhere and all you need to do is clip
    it on your shaving handle and shave. Face it (pun intended), it’s
    probably worth getting the Braun 790cc shaver if
    only to make mornings more comfortable. (You any
    wash your face first with a shaving wash and put pre-shaving lotion or cream if you want
    to.

    Here is my weblog: electric shaver reviews, Sheila,

  17. Oh baby Chop up all the same. James became the battle cry of the Spanish army.
    Character customization is an enormous element in you could try here Row: The Third
    and Ultimate Marvel vs. The most exciting part of this
    post eludes to us making poop salsa, this is the way to salvation.

  18. Pretty nice post. I just stumbled upon your weblog and wanted to say
    that I have really enjoyed surfing around your blog posts.

    In any case I’ll be subscribing to your rss feed
    and I hope you write again very soon!

  19. Cool blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple adjustements would really make
    my blog stand out. Please let me know where you got your
    design. Thanks

  20. hay day hack says:

    What’s up to every single one, it’s in fact a good for me to pay a visit
    this site, it contains helpful Information.

  21. Hi mates, how is everything, and what you want to say
    about this post, in my view its genuinely awesome in support of me.

  22. I am really impressed with your writing skills as well as with the layout on your blog.
    Is this a paid theme or did you customize it yourself? Anyway keep up
    the excellent quality writing, it is rare to see a nice blog like
    this one these days.

  23. Hi! This is my first comment here so I just wanted to give a quick shout out and say I genuinely enjoy reading your
    blog posts. Can you recommend any other blogs/websites/forums that go over the same topics?
    Thank you so much!

  24. There is a product best way to lose weight devised for weight loss as well.
    Understand that since fat loss takes time to happen, you can still become fat
    eating astronomical amounts of them. Many people tend to have best way
    to lose weight wafers, candies and cookies during snacks, rather than anything drastic
    and sudden like crash diets or bursts of exercise.

Add a Comment