Connecting to MSSQL with Apache and PHP on Windows

I set up a Windows server as a WAMP server (Windows, Apache, MySQL, and PHP) to run vBulletin. Everything worked fine, and the learning curve was pretty short.

Then I tried getting PHP to connect to a remote Microsoft SQL server. Sorry, no luck!

The apparent fix required an updated ntwdblib.dll. The one that came with the latest PHP5 bits (5.2.6) was apparently out of date (version 2000.2.8.0). A newer one, which I founded linked to from a UserScape support page, is version 2000.80.194.0. Shut down Apache, download the newer DLL (replacing the old DLL), and restart Apache. Viola! Hello, MSSQL server.

Popularity: 16%

Related Posts

I would rather be the offspring of two apes than be a man and afraid to face the truth

-- Thomas Henry Huxley

Comments 2

  1. Alex wrote:

    You can try the Microsoft’s PHP MS SQL server extension, which I described in my blog: http://www.alexatnet.com/node/93

    Posted 16 May 2008 at 1:18 pm
  2. brian wrote:

    The MS PHP SQL extension seems a nice idea… but when existing PHP applications are coded against the PHP MSSQL API, it’s not a useful solution.

    The SQL 2005 PHP driver blog (http://blogs.msdn.com/sqlphp/) has just five posts (one being a ‘welcome’ post) since Oct 2007. Damn, must be a cushy job being the Program Manager of the SQL Server Driver for PHP! ;)

    Posted 16 May 2008 at 2:55 pm

Post a Comment

Your email is never published nor shared. Required fields are marked *