0

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?

F__M
  • 1,518
  • 1
  • 19
  • 34
Rich Jenks
  • 1,723
  • 5
  • 19
  • 32

1 Answers1

1

Sounds like the SQL Native Client is missing.

System Requirements

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

Community
  • 1
  • 1
Honk der Hase
  • 2,459
  • 1
  • 14
  • 26
  • I installed this but PHP still reports that neither the sqlsrv or the out-dated mssql drivers are present. That said, it's not the simplest of packages to identify - could you please provide a link to ensure I'm using installing the right thing? – Rich Jenks Jun 04 '13 at 08:45
  • You will try to google the correct way of installing sql server drivers (one example http://robsphp.blogspot.co.uk/2012/09/how-to-install-microsofts-sql-server.html) php_pdo_sqlsrv_54_ts.dll are you sure, you've selected the correct dll file? I thinks this one is for a VC9 built of apache. – Honk der Hase Jun 04 '13 at 10:19