Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 5.5 and MSSQL driver: Installing ODBC Driver 11 in Windows Server 2012 R2

I have a Windows Server 2012 R2 with IIS 8.5, and another server with MSSQL 2012. I must install PHP in IIS and connect to MSSQL, and I don't have Internet available for Web PI.

I managed to install PHP 5.5 and I'm able to run phpinfo(), and I also assured that php.ini is being loaded from C:\php\php.ini.

I was also able to load sqlsrv driver, it reports in example sqlsrv.ClientBufferMaxKBSize 10240 10240.

But when I execute a php file that connects to DB, I get a message

This extension requires the ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712

I went to that site and it says

Supported operating systems for version 3.1 of the driver include Windows Server 2012 R2`.

It says

Version 3.1 requires Microsoft ODBC Driver 11 (or higher) for SQL Serverand points tohttp://www.microsoft.com/en-us/download/details.aspx?id=36434`.

In that page, in System Requirements, WinServer 2012 R2 is not listed. When I try to install msodbcsql.msi I get message

Installation of this product failed because it is not supported on this operation system. For information on supported configurations, see the product documentation.`

Well I'm now stuck. I need PHP in WinServer 2012 R2 and IIS 8.5 connecting to MSSQL 2012. But its driver requires ODBC 11, which seems to not support latest WinServer.

Is there any hope, or will I need to wait for Microsoft to support its own OS in its own drivers?

like image 926
Hikari Avatar asked Jan 26 '15 13:01

Hikari


People also ask

What is ODBC driver 11 SQL Server?

Microsoft ODBC Driver 11 for SQL Server is a single dynamic-link library (DLL) containing run-time support for applications using native-code APIs to connect to Microsoft SQL Server 2005, 2008, 2008 R2, SQL Server 2012, SQL Server 2014 and Windows Azure SQL Database.

Which ODBC driver should I use for SQL Server?

Microsoft ODBC Driver for SQL Server (MSODBCSQL) Driver history for Microsoft SQL Server recommends this driver in preference to "SQL Server" and "SQL Server Native Client" for ODBC.

Are ODBC Drivers backwards compatible?

Backward compatibility is the ability of newer ODBC components to work with old ODBC components. The following sections discuss how these components are affected by the changes in ODBC 3. x. The information contained in them primarily addresses the writing of an ODBC 3.

How do I update ODBC Drivers?

To update the ODBC driver Windows users can simply download and run the installer for the most current version. The installer will replace the existing ODBC driver installation on the system with the most current version. However, it isn't always practical to replace an entire installation.


1 Answers

Be sure to download the 1033\x64\msodbcsql.msi (4.4 MB) installer. Even though you are using PHP x86, you need the x64 installer since the OS is x64. I had the same issue and my app now works with PHP x86 after installing the x64 installer.

like image 107
Sean Decker Avatar answered Oct 04 '22 13:10

Sean Decker