Rich Jenks
Rich Jenks

Reputation: 1773

Connecting to MS SQL Server in PHP

I'm running a WAMP stack and and trying to connect to an SQL Server instance with PHP's PDO.

I've downloaded the PHP drivers for MS SQL from here and added **php_pdo_sqlsrv_54_ts.dll** into PHP's extension folder.

Then added "php_pdo_sqlsrv_54_ts.dll" to the list of extensions in php.ini.

I know I'm using the correct driver because I'm using PHP version 5.4.3 and **phpinfo()** reports that it's thread-safe.

However, after restarting Apache **phpinfo()** (and **PDO::getAvailableDrivers()**) both report that only the mysql, odbc and sqlite PDO drivers are loaded.

This means that when I attempt to connect to my SQL Server instance I get the error:

could not find driver

Can anyone advise on how to get this working?

Upvotes: 0

Views: 235

Answers (1)

Honk der Hase
Honk der Hase

Reputation: 2488

Sounds like the SQL Native Client is missing.

System Requirements

Microsoft SQL Server 2012 Native Client available in the SQL Server 2012 Feature Pack.

Upvotes: 1

Related Questions