« Previous Next »

Thread: Issues with MS SQL and PHP

Last post 03-26-2009 10:34 PM by stjacobs. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 03-25-2009, 7:44 PM

    • sminnee
    • Not Ranked
    • Joined on 03-25-2009, 11:42 PM
    • Posts 2

    Issues with MS SQL and PHP

    I emailed Jake about this directly; posting here for posterity.

    Q: We're trying to connect to a MS SQL server from the version of PHP that the Web Platform Installer installs, and we're running into the following problem.

    A: There are a few things going on here.

    • The MS SQL driver that ships with PHP is based on some MS SQL Client Libraries that were end-of-life’d a couple of years ago. We install the driver for a couple of applications which ship with the pre-requisites themselves. We would not recommend using it for any new development.
    • There is a MS SQL PHP Driver produced by the MS SQL folks - http://www.microsoft.com/downloads/details.aspx?FamilyId=61BF87E0-D031-466B-B09A-6597C21A2E2A&displaylang=en. I would use this driver instead.
    • When you start PHP with the base config as we ship it, that MS SQL Driver will fail to load if you don’t have the client libraries. This isn’t a fatal error though, so you are only likely to see the error if you either start PHP from the command line, or if you are logging errors to a file.
  • 03-25-2009, 10:54 PM In reply to

    Re: Issues with MS SQL and PHP

    Hi,

    I have followed these instructions, and phpinfo() still does not show mssql support.

    I installed SQL Server Native Client 2005, and the DLL files are in the System32 directory alongside the 2008 versions of the same thing.

    From what I've read on the web, there seems to be a missing DLL - ntwdblib.dll . This is present in the standard PHP download from php.net, but doesn't seem to be installed with the Web Application Gallery.

    However, even when I include this in the system32 directory, it still doesn't register mssql support.

    So I'm wondering where I've gone wrong. Any assistance would be greatly appreciated.

    Thanks,
    Geoff

  • 03-26-2009, 10:34 PM In reply to

    • stjacobs
    • Top 150 Contributor
    • Joined on 09-23-2008, 3:09 PM
    • Redmond
    • Posts 43

    Re: Issues with MS SQL and PHP

    Hi Geoff,

    The SQL Server Driver that ships with PHP 5.2.9 is there for legacy applications.  For new development such as yours, you should comment it out:

    [PHP_MSSQL]
    ;extension=php_mssql.dll

    The best places to learn about the new SQL PHP Driver are:

    sqlsrv

    sqlsrv support enabled
    Directive Local Value Master Value
    sqlsrv.LogSeverity 0 0
    sqlsrv.LogSubsystems 0 0
    sqlsrv.WarningsReturnAsErrors On On


    Let me know if this helps.

     Thanks!

     -Jake

    --
    Steve Jacobson (Jake)
    Sr. Program Manager - IIS
Page 1 of 1 (3 items)
Microsoft Communities