php starup sqlsrv unable to initialize module
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.
Comments
-
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 over 11 yearsIt's 5.4.4 and thread safety is enabled. From where could i get hold of the correct DLL ?
-
VolkerK over 11 yearsThe 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 over 11 yearsYes, 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 over 11 yearsBy doing what the error message says. Download the native client and install it.
-
morph85 over 7 yearsTo 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.