I've never been able to get SQL Server to play nicely in my WAMP environment, and I trying to finally solve it once and for all.
Tried:
extension=php_sqlsrv_54_ts.dll
.PDO::getAvailableDrivers()
... got only Array( [0]=>mysql, [1]=>sqlite )
Now, I understand that PDO is included natively in PHP 5.3+, but since the MS instructions explicitly requires that extension=php_pdo.dll
be enabled, so I figured I'd give that a shot too.
I downloaded the DLL from dlldll.com (1st encounter with that site, so I hoping it's a reputable source), extracted and moved the _php_pdo.dll_ file to my \wamp\bin\php\php5.4.3\ext dir, then added it into both the php.ini files ... no improvement.
As a side note, when I check the list of activated PHP ext's from the WAMPSERVER menu, the sqlserver extensions don't even show up on the list.
Just to test it out, I also tried uncommenting extension=php_pdo_pgsql.dll
in the php.ini's, and that worked just fine ... "pgsql" was included in the avail drivers array.
My setup:
What next?
I'm just about out of ideas.
The only thing I can think of is that maybe the SQLSRV drivers are 32bit, and not playing nicely with my 64bit setup ... ooohhh goodness .. I sure hope not.
Any tips/pointers are welcome ... especially if they don't include completely reinstalling ;)
I was able to get the sqlsvr PHP PDO driver working on my slightly older version of WAMP 32-bit. Here is my setup:
Here is what I did:
Added this line to my apache php.ini file (C:\wamp\bin\apache\Apache2.2.21\bin\php.ini)
extension=php_pdo_sqlsrv_53_ts.dll
Downloaded and installed MS SQL Server 2012 Native Client ODBC driver from here: http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409
After these steps my PHP code happily connected to my SQL Server database.