php starup sqlsrv unable to initialize module

28,598

Solution 1

Looks like you've tried to install the sqlsrv extension for php 5.3 on a php 5.2 system.

Either run <?php phpinfo(); ?> and look for the php version and look for the following entries:

  • PHP Version
  • Thread Safety

pick the appropriate .dll from the sqlsrv driver: the version number must match and if thread safety is enabled pick the ts version, if not pick the nts version.

Solution 2

For anyone trying to get it to work with PHP 5.5 (PHP compiled with module API=20121212) then you can replace the dlls in the ext folder with new updated binaries >here<

Don't forget to enable the new dlls in the php configuration.

Share:
28,598
Illep
Author by

Illep

I love writing code.

Updated on November 04, 2020

Comments

  • Illep
    Illep over 3 years

    I am trying to connect MSSQL to PHP. i am following this tutorial. Anyway after i added the dll files as described in that tutorial, i get the following warning. How can i solve this ?

    php starup sqlsrv unable to initialize module module compiled with module api=20090626 php compiled with module api=20020520 these options need to match
    

    note:i have gone through this post but none helped.

  • Illep
    Illep over 11 years
    It's 5.4.4 and thread safety is enabled. From where could i get hold of the correct DLL ?
  • VolkerK
    VolkerK over 11 years
    The tutorial you've linked to contains a link to the driver package. This pacakage contains a file php_sqlsrv_54_ts.dll which sounds right.
  • Illep
    Illep over 11 years
    Yes, after adding that i get the following error This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86. How can i solve this ?
  • VolkerK
    VolkerK over 11 years
    By doing what the error message says. Download the native client and install it.
  • morph85
    morph85 over 7 years
    To reply on @lllep comment, you would need to download OCBC driver from: microsoft.com/download/details.aspx?id=36434 in case if you are using SQLSRV 3.1/3.2 for PHP5.5/5.6.