MSSQL Driver, and PHP 5.3, Support or Release Schedule? RRS feed

  • Question

  • It's looking like the SQL Driver for PHP isn't working for 5.3.x, and may not until version 1.1, is that correct?

    Since 5.3 droppped so recently, I'm not coming up with much help while STFW.

    I downloaded the Cumulative Update:

    Stuck the line in my php.ini:

    I receive this error:

    PHP Startup: sqlsrv: Unable to initialize module
    Module compiled with module API=20060613
    PHP compiled with module API=20090626
    These options need to match

    Monday, July 6, 2009 10:04 PM


All replies

  • I'm wishing I would have researched this before, I really don't want to drop back to 5.2.x

    Thanks in advance for any help.
    Monday, July 6, 2009 10:05 PM
  • yikes. Me too! Iam not getting an error, it just doesn't load. MS? Help! We'll go ODBC before we drop down from 5.3.0.
    Tuesday, July 7, 2009 4:42 PM
  • While the binaries for April 2009 cumulative update are built for PHP 5.2, the source code was updated to enable compilation under PHP 5.3. The source code of the driver is available on the CodePlex site. 


    The next version of the driver (i.e. v1.1) will include binaries compatible with PHP 5.3. A CTP for v1.1 will available next month. Until then, the only alternative for using the driver with PHP 5.3 is to rebuild it based on the source code downloaded from the CodePlex site.


    Hope that helps,



    Serban Iliescu - MSFT
    Tuesday, July 7, 2009 5:59 PM
  • I just compile it under 5.3, but it still will not load.
    Wednesday, July 8, 2009 4:14 PM
  • What are the messages that it gives for not loading? 

    5.3 added a requirement that the compiler for an extension and the compiler for the PHP 5.3 runtime have to match, ostensibly to minimise the support questions about extensions not loading.  5.3 has two flavors also, VC6 and VC9 (2008).  Our extension will not compile under VC6.  It should compile under VC8 (2005) or VC9 (2008) with no changes.

    If you don't have either of these compilers, you can download and use the VC++ Express versions.  The extension has been verified to compile with those compilers, and they're free.
    Thursday, July 9, 2009 6:32 AM
  • I should have followed up. I accidentally compiled it incorrectly the first time. I think I compiled with thread saftety turned on...or something. The non-ts sql_srv.dll was 200kb+, which I knew was incorrect. Once i compiled it correctly, it worked like a champ. It was actually cool learning to compile PHP.

    I used these instructions here:


    And then the readme.txt file to compile with the extension.
    Thursday, July 30, 2009 5:40 AM
  • Would it be to much to ask that the existing driver be compiled with VC9.  Here my apache startup log:

    PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module\nModule compiled with module API=20060613
    PHP    compiled with module API=20090626
    These options need to match
     in Unknown on line 0
    [Tue Aug 11 17:58:54 2009] [notice] Apache/2.2.13 (Win32) PHP/5.3.0 configured -- resuming normal operations
    [Tue Aug 11 17:58:54 2009] [notice] Server built: Aug  7 2009 21:52:15

    Is there source and instructions for compiling the module.  What I am seeing here are instructions to compile PHP.

    Tuesday, August 11, 2009 10:22 PM

  • These instructions include how to compile the extension. To compile an extension for PHP, you have to compile PHP and include the extension in the compiling.
    Wednesday, August 12, 2009 4:04 AM
  • Monday, August 17, 2009 11:59 PM