How to Install Pdo_Sqlsrv on My Windows 2008 Server 2008 R2

PHP 5.5.0 w/ Microsoft SQL Server 2008 R2 - No sqlsrv_connect()?

PHP 5.5 compiled with VC11, so the driver must be compiled with VC11 too. You can download PHP SQL Server driver (compiled with VC11) from here:

SQL Server PHP Driver For PHP 5.5

SQLSRV driver installed but shows error while connecting to MSSQL 2008 R2 db using PHP

Have you installed the feature pack?

http://microsoft.com/en-us/download/details.aspx?id=29065

A hint from the error tells us that you need the 2012 version of the MS SQL Server for this to work. Also make sure your Server permissions are set correctly.

Connecting to a SQL 2008 R2 server through XAMPP

The clue to solving your problem is in the error message:

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server
2012 Native Client ODBC Driver to communicate with SQL Server.
Access
the following URL to download the Microsoft SQL Server 2012 Native
Client ODBC driver for x86: go.microsoft.com/fwlink/?LinkId=163712';

It would appear that you don't have the SQL Server Native Client drivers installed.

Browse to this URL:

Microsoft® SQL Server® 2012 Feature Pack

Scroll down until you see:

Microsoft® SQL Server® 2012 Native Client

Download and run the installer for the X86 Package (http://go.microsoft.com/fwlink/?LinkID=239647&clcid=0x409)

Error!: could not find driver' after installing php_[pdo_]mssql.dll on WampServer

In case anyone else ends up here while trying to solve this problem, here are the steps that have worked for me the two times I've done it. These steps worked both on Windows Server 2008 R2 and Windows 8.

For my purposes, I used the latest 32-bit (x86) version of WampServer (at the time of this writing, it was 2.4, and came with Apache 2.4.4 and PHP 5.4.16). The 32-bit version is necessary, as the drivers are 32-bit; the 64-bit version will not work.

  1. Install Microsoft Visual C++ 2010 Redistributable Package x86
  2. Install Microsoft SQL Server 2008 Native Client x86 (Click "Download" and select ENU\x86\sqlncli.msi. Once again, the 64-bit version will not work)
  3. Install Microsoft ODBC Driver 11 x86 (Click "Download" and select 1033\x86\msodbcsql.msi)
  4. Install Microsoft SQLSRV driver 3.0 in php/ext/ (For my installation, this was C:/wamp/bin/php/php5.4.16/ext/)
  5. Edit Apache's php.ini to include the line extension=php_pdo_sqlsrv_54_ts.dll (for my installation, this was located in C:/wamp/bin/apache/Apache2.4.4/bin/)


Related Topics



Leave a reply



Submit