php 7 unable to initialize sqlsrv

Pierre-Luc Bolduc picture Pierre-Luc Bolduc · Oct 4, 2015 · Viewed 30k times · Source

I searched all day to find out a solution for sqlsrv dll on php 7 VC14 x64 Thread Safe and i did not found a solution. Does anyone solved this issue :

[04-Oct-2015 19:48:05 UTC] PHP Warning:  PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20141001
These options need to match
 in Unknown on line 0

Here is my php7 RC4 informations :

System  Windows NT 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) AMD64
Build Date  Sep 29 2015 17:15:28
Compiler    MSVC14 (Visual C++ 2015)
Architecture    x64

Answer

kba picture kba · Nov 19, 2015

sqlsrv isn't ready for PHP7 yet but that's not true it wasn't released since 2012. Last release is from May 2015. Maintainer is Microsoft and version for PHP7 is planned on the beginning of next year.

https://github.com/Azure/msphpsql/issues/58

Update:

Driver is available for PHP up to 7.1 version even for Linux today (March 2017).

https://github.com/Microsoft/msphpsql