3
votes

I am gettin following error when I connect to mssql

Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server

And I am using

$db = new PDO("sqlsrv:server=127.0.0.1;database=test;", "sa", "mypassword");

I have also added driver in C:\xampp\php\ext and set that extension in php.ini file [PHP_PDO_MSSQL] extension=php_pdo_sqlsrv_54_ts.dll

I have tried several tutorials, what exactly I am doing, Please tell what I am doing wrong?

1
It may seem trivial, but did you make sure to restart Apache after editing the ini file?Amo

1 Answers

0
votes

what version of the php pdo sqlsrv are you using?

Try updating it to v3.1 http://www.microsoft.com/en-us/download/details.aspx?id=20098

You might neet the ODBC driver as well: http://www.microsoft.com/en-us/download/details.aspx?id=36434