Error: "PHP Startup: sqlsrv: Unable to initialize module"

4

I'm trying to access SQL Server through XAMPP on Windows 7 64 bit but I'm not getting it, I've already followed the tutorials step by step but at the time of starting Apache it gives the error in the line below:

Line that gives the error

extension=php_sqlsrv_54_ts.dll

Error message.

  

[31-Oct-2014 11:12:29 UTC] PHP Warning: PHP Startup: sqlsrv: Unable   to initialize module Module compiled with module API = 20100525 PHP
  compiled with module API = 20121212 These options need to match   Unknown on line 0

    
asked by anonymous 31.10.2014 / 12:13

2 answers

4

Xammp does not come with the required DLLs for connecting to SQL Server, you need to manually download and copy it to your PHP extensions folder.

You can download latest driver here .

This file is a self-extractor that will extract the DLLs to the directory you choose.

Once this is done, you must choose the appropriate DLL and copy it to the ext folder of PHP. This MSDN page indicates which DLL you should use according to the PHP version.

XAMPP comes with the Thread Safety (TS) version of PHP. Copy it to the directory xampp\php\ext to dll php_sqlsrv_XX_ts.dll , where XX matches your version of PHP. Finally, in the configuration file include the DLL line.

extension=php_sqlsrv_XX_ts.dll

Or if you want to use SQL Server with the PDO:

extension=php_pdo_sqlsrv_XX_ts.dll

Note: The latest official version of SQL Server drivers is compatible with PHP 5.4.

If you are using PHP 5.5 or higher, you can turn to a unofficial while Microsoft does not release the new official version and to prioritize the release of the official compatible version.

Update: The official driver has been updated and supports up to the latest stable version of PHP (5.6)     

31.10.2014 / 12:38
0

Summarizing everything we've written.

The solution is to use unofficial link

But just in case I'm using the previous one.

    
31.10.2014 / 16:17