I am using the PHP version 5.3.8, which was installed via XAMPP along with Microsoft SQL Server 2008 R2 (SQLEXPRESS). I installed the drivers correctly (I think) and added the correct line to php.ini (extension = php_pdo_sqlsrv_53_ts_vc9.dll, to be precise).
I am trying to connect to the server like this:
try { $DBH = new PDO("mssql:host=xxxx;dbname=xxxx", 'xxxx', 'xxxx'); } catch(PDOException $e) { echo $e->getMessage(); }
I get a โcan't find driverโ error, and I reworked all sorts of ways to solve the problem. I tried all other types of drivers, but this is the only one that Apache does not give me an error on startup. When I run phpinfo (), the pdo_sqlsrv fields are empty except for pdo_sqlsrv.log_severity, which is set to 0.
I DL'd my drivers from microsoft , and I tried both 2.0 and 3.0
Any advice would be awesome !!
user2333765
source share