Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php starup sqlsrv unable to initialize module

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.

like image 730
Illep Avatar asked Aug 28 '12 07:08

Illep


2 Answers

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.

like image 95
VolkerK Avatar answered Oct 08 '22 19:10

VolkerK


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.

like image 42
Simon Francesco Avatar answered Oct 08 '22 18:10

Simon Francesco