For those still having issues with this plugin:
This plugin does work with wordpress 3.5 and sql server 2005 (not tested on 2008 or 2012 yet, but will be trying an install on 2012 soon) with some slight tweaks to the plugin, but it was quite a nightmare finding the information in one place. Many thanks and credits go to the people of this forum for finding these fixes of which I take no credit for myself. However, there was no complete guide as to which fixes are required to get this to work, so I compiled the following information which I hope is useful for people wanting to install brand new wordpress sites using mssql and iis7.5.
This post assumes you have already installed the php_sqlsrv_54_nts.dll extension on your php fast-cgi module and set display_errors
to off. Also to prevent warnings regarding unexpected mysql query formats from being sent to the browser you need to append ~E_WARNING
to the error_reporting
value in your php.ini file.
Before the installation is started the following files in the plugin must be amended:
In translations.php:
Make sure extra parenthesis has been removed from $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*)(;{0,1})$/is';
The resulting line will be: $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*);{0,1}$/is';
In mu_plugins\wp-db-abstraction\drivers\sqlsrv.php the following line needs to be added to the end of function db_connect()
:
@sqlsrv_query($this->dbh,'SET DATEFORMAT ymd');
This will correctly allow for datetime to be interpreted by wordpress due to the way in which mssql formats datetime. The format of course can be changed within wordpress itself later to correspond to the preferred date format.
Finally, make sure url rewrite 2.0 is installed on the iis7.5 server and the following web.config file is in the root of the wordpress installation:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<clear/>
<add value="index.php"/>
</files>
</defaultDocument>
<httpErrors errorMode="Detailed" />
</system.webServer>
</configuration>
Once these small modifications have been completed the installation can then be started. Absolutely no modifications to the core code of wordpress are required for this to work.
The only problems I’ve found after installing are:
– using permalinks will break the site
– scheduled posts don’t seem to run.
– posts will not save if they contain backslashes.
– when creating a new post, “post immediately” is not displayed because wordpress will not find a post with an unassigned date (0000-00-00 00:00:00). ms sql does not allow this in datetime fields. Instead the date and time of when you clicked “add new” will be displayed which is taken from the autodraft I believe. Nothing to worry about here but thought it was worth noting.
These are minor problems that do not affect the main functionality of the site it seems. Hopefully these small issues will be addressed.
Otherwise everything else is perfect.
Well done and many many thanks to the authors of this plugin and the users who found these fixes.