Microsoft Odbc Driver 11 For Sql Server

The ODBC Driver 11 for SQL Server supports connections to SQL Server 2014, SQL Server 2012 R2, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005 (9.x). The ODBC Driver 11 for SQL Server on Windows can be installed on a computer that also has one or more versions of SQL Server Native Client. The ODBC driver comes with tools such as sqlcmd and bcp. The sqlcmd utility lets you run Transact-SQL statements, system procedures, and SQL scripts. The bcp utility bulk copies data between an instance of Microsoft SQL Server and a data file in a format you choose. The Microsoft ODBC Drivers for SQL Server are stand-alone ODBC drivers which provide an application programming interface (API) implementing the standard ODBC interfaces to Microsoft SQL Server. The Microsoft ODBC Driver for SQL Server can be used to create new applications.

-->

This document lists the components that must be installed on your system to access data in a SQL Server or Azure SQL Database using the Microsoft Drivers for PHP for SQL Server.

Versions 3.1 and later of the Microsoft PHP Drivers for SQL Server are officially supported. For full details on support lifecycles and requirements including earlier versions of the PHP drivers, see the support matrix.

PHP

For information about how to download and install the latest stable PHP binaries, see the PHP web site. The Microsoft Drivers for PHP for SQL Server require the following versions of PHP:

PHP for SQL Server driver version →
↓ PHP version
5.65.35.24.34.03.23.1
7.37.3.0+
7.27.2+17.2+17.2+1
7.17.1.0+7.1.0+7.1.0+7.1.0+
7.07.0.0+7.0.0+7.0.0+7.0.0+
5.65.6.4+
5.55.5.16+5.5.16+
5.45.4.325.4.32
  1. Versions 7.2.1 and later are supported on Windows, while versions 7.2.0 and later are supported on Linux and macOS.
  • A version of the driver file must be in your PHP extension directory. See Driver Versions for information about the different driver files. To download the drivers, see Download the Microsoft Drivers for PHP for SQL Server. For information on configuring the driver for the PHP, see Loading the Microsoft Drivers for PHP for SQL Server.

  • A Web server is required. Your Web server must be configured to run PHP. For information about hosting PHP applications with IIS, see the tutorial on PHP's web site.

    The Microsoft Drivers for PHP for SQL Server has been tested using IIS 10 with FastCGI.

ODBC Driver

The correct version of the Microsoft ODBC Driver for SQL Server is required on the computer on which PHP is running. You can download all supported versions of the driver for supported platforms on this page.

If you are downloading the Windows version of the driver on a 64-bit version of Windows, the ODBC 64-bit installer installs both 32-bit and 64-bit ODBC drivers. If you use a 32-bit version of Windows, use the ODBC x86 installer. On non-Windows platforms, only 64-bit versions of the driver are available.

PHP for SQL Server driver version →
↓ ODBC Driver version
5.65.35.24.34.03.23.1
ODBC Driver 17+YYY
ODBC Driver 13.1YYYYY
ODBC Driver 13Y
ODBC Driver 11YYYYYYY

If you are using the SQLSRV driver, sqlsrv_client_info returns information about which version of SQL Server Microsoft ODBC Driver for SQL Server is being used by the Microsoft Drivers for PHP for SQL Server. If you are using the PDO_SQLSRV driver, you can use PDO::getAttribute to discover the version.

SQL Server

Azure SQL Databases are supported. For information, see Connecting to Microsoft Azure SQL Database.

Bcp
PHP for SQL Server driver version →
↓ SQL Server version
5.65.35.24.34.03.23.1
Azure SQL DatabaseYYYY
Azure SQL Managed InstanceYYYY
Azure SQL Data WarehouseYYYY
SQL Server 2017YYYY
SQL Server 2016YYYYY
SQL Server 2014YYYYYYY
SQL Server 2012YYYYYYY
SQL Server 2008 R2YYYYYYY
SQL Server 2008YYY

Operating Systems

Supported operating systems for each version of the driver are as follows:

PHP for SQL Server driver version →
↓ Operating system
5.65.35.24.34.03.23.1
Windows Server 2016YYYY
Windows Server 2012 R2YYYYYYY
Windows Server 2012YYYYYYY
Windows Server 2008 R2 SP1YYY
Windows Server 2008 SP2YYY
Windows 10YYYYY
Windows 8.1YYYYYYY
Windows 8YYYY
Windows 7 SP1YYY
Windows Vista SP2YYY
Ubuntu 18.10 (64-bit)Y
Ubuntu 18.04 (64-bit)YY
Ubuntu 17.10 (64-bit)YY
Ubuntu 16.04 (64-bit)YYYYY
Ubuntu 15.10 (64-bit)Y
Ubuntu 15.04 (64-bit)Y
Debian 9 (64-bit)YYY
Debian 8 (64-bit)YYYY
Red Hat Enterprise Linux 7 (64-bit)YYYYY
Suse Enterprise Linux 15 (64-bit)Y
Suse Enterprise Linux 12 (64-bit)YYY
macOS Mojave (64-bit)Y
macOS High Sierra (64-bit)YY
macOS Sierra (64-bit)YYYY
macOS El Capitan (64-bit)YYY

Driver Versions

This section lists the driver files that are included with each version of the Microsoft Drivers for PHP for SQL Server. Each installation package contains SQLSRV and PDO_SQLSRV driver files in threaded and non-threaded variants. On Windows, they are also available in 32-bit and 64-bit variants. To configure the driver for use with the PHP runtime, follow the installation instructions in Loading the Microsoft Drivers for PHP for SQL Server.

On supported versions of Linux and macOS, the appropriate drivers can be installed using PHP's PECL package system, following the Linux and macOS installation instructions. Alternatively, you can download prebuilt binaries for your platform from the Microsoft Drivers for PHP for SQL Server Github project page -- the tables below list the files found in the prebuilt binary packages.

Microsoft Drivers 5.6 for PHP for SQL Server:

On Windows, the following versions of the driver are included:

Driver filePHP versionThread safe?Use with PHP .dll
32-bit php_sqlsrv_71_nts.dll
32-bit php_pdo_sqlsrv_71_nts.dll
7.1no32-bit php7.dll
32-bit php_sqlsrv_71_ts.dll
32-bit php_pdo_sqlsrv_71_ts.dll
7.1yes32-bit php7ts.dll
64-bit php_sqlsrv_71_nts.dll
64-bit php_pdo_sqlsrv_71_nts.dll
7.1no64-bit php7.dll
64-bit php_sqlsrv_71_ts.dll
64-bit php_pdo_sqlsrv_71_ts.dll
7.1yes64-bit php7ts.dll
32-bit php_sqlsrv_72_nts.dll
32-bit php_pdo_sqlsrv_72_nts.dll
7.2no32-bit php7.dll
32-bit php_sqlsrv_72_ts.dll
32-bit php_pdo_sqlsrv_72_ts.dll
7.2yes32-bit php7ts.dll
64-bit php_sqlsrv_72_nts.dll
64-bit php_pdo_sqlsrv_72_nts.dll
7.2no64-bit php7.dll
64-bit php_sqlsrv_72_ts.dll
64-bit php_pdo_sqlsrv_72_ts.dll
7.2yes64-bit php7ts.dll
32-bit php_sqlsrv_73_nts.dll
32-bit php_pdo_sqlsrv_73_nts.dll
7.3no32-bit php7.dll
32-bit php_sqlsrv_73_ts.dll
32-bit php_pdo_sqlsrv_73_ts.dll
7.3yes32-bit php7ts.dll
64-bit php_sqlsrv_73_nts.dll
64-bit php_pdo_sqlsrv_73_nts.dll
7.3no64-bit php7.dll
64-bit php_sqlsrv_73_ts.dll
64-bit php_pdo_sqlsrv_73_ts.dll
7.3yes64-bit php7ts.dll

On Linux, the following versions of the driver are included:

Driver filePHP versionThread safe?
php_sqlsrv_71_nts.so
php_pdo_sqlsrv_71_nts.so
7.1no
php_sqlsrv_71_ts.so
php_pdo_sqlsrv_71_ts.so
7.1yes
php_sqlsrv_72_nts.so
php_pdo_sqlsrv_72_nts.so
7.2no
php_sqlsrv_72_ts.so
php_pdo_sqlsrv_72_ts.so
7.2yes
php_sqlsrv_73_nts.so
php_pdo_sqlsrv_73_nts.so
7.3no
php_sqlsrv_73_ts.so
php_pdo_sqlsrv_73_ts.so
7.3yes

Microsoft Drivers 5.3 for PHP for SQL Server:

On Windows, the following versions of the driver are included:

Driver filePHP versionThread safe?Use with PHP .dll
32-bit php_sqlsrv_7_nts.dll
32-bit php_pdo_sqlsrv_7_nts.dll
7.0no32-bit php7.dll
32-bit php_sqlsrv_7_ts.dll
32-bit php_pdo_sqlsrv_7_ts.dll
7.0yes32-bit php7ts.dll
64-bit php_sqlsrv_7_nts.dll
64-bit php_pdo_sqlsrv_7_nts.dll
7.0no64-bit php7.dll
64-bit php_sqlsrv_7_ts.dll
64-bit php_pdo_sqlsrv_7_ts.dll
7.0yes64-bit php7ts.dll
32-bit php_sqlsrv_71_nts.dll
32-bit php_pdo_sqlsrv_71_nts.dll
7.1no32-bit php7.dll
32-bit php_sqlsrv_71_ts.dll
32-bit php_pdo_sqlsrv_71_ts.dll
7.1yes32-bit php7ts.dll
64-bit php_sqlsrv_71_nts.dll
64-bit php_pdo_sqlsrv_71_nts.dll
7.1no64-bit php7.dll
64-bit php_sqlsrv_71_ts.dll
64-bit php_pdo_sqlsrv_71_ts.dll
7.1yes64-bit php7ts.dll
32-bit php_sqlsrv_72_nts.dll
32-bit php_pdo_sqlsrv_72_nts.dll
7.2no32-bit php7.dll
32-bit php_sqlsrv_72_ts.dll
32-bit php_pdo_sqlsrv_72_ts.dll
7.2yes32-bit php7ts.dll
64-bit php_sqlsrv_72_nts.dll
64-bit php_pdo_sqlsrv_72_nts.dll
7.2no64-bit php7.dll
64-bit php_sqlsrv_72_ts.dll
64-bit php_pdo_sqlsrv_72_ts.dll
7.2yes64-bit php7ts.dll

On Linux, the following versions of the driver are included:

Driver filePHP versionThread safe?
php_sqlsrv_7_nts.so
php_pdo_sqlsrv_7_nts.so
7.0no
php_sqlsrv_7_ts.so
php_pdo_sqlsrv_7_ts.so
7.0yes
php_sqlsrv_71_nts.so
php_pdo_sqlsrv_71_nts.so
7.1no
php_sqlsrv_71_ts.so
php_pdo_sqlsrv_71_ts.so
7.1yes
php_sqlsrv_72_nts.so
php_pdo_sqlsrv_72_nts.so
7.2no
php_sqlsrv_72_ts.so
php_pdo_sqlsrv_72_ts.so
7.2yes

Microsoft Drivers 5.2 for PHP for SQL Server:

How To Update Odbc Drivers

On Windows, the following versions of the driver are included:

Driver filePHP versionThread safe?Use with PHP .dll
32-bit php_sqlsrv_7_nts.dll
32-bit php_pdo_sqlsrv_7_nts.dll
7.0no32-bit php7.dll
32-bit php_sqlsrv_7_ts.dll
32-bit php_pdo_sqlsrv_7_ts.dll
7.0yes32-bit php7ts.dll
64-bit php_sqlsrv_7_nts.dll
64-bit php_pdo_sqlsrv_7_nts.dll
7.0no64-bit php7.dll
64-bit php_sqlsrv_7_ts.dll
64-bit php_pdo_sqlsrv_7_ts.dll
7.0yes64-bit php7ts.dll
32-bit php_sqlsrv_71_nts.dll
32-bit php_pdo_sqlsrv_71_nts.dll
7.1no32-bit php7.dll
32-bit php_sqlsrv_71_ts.dll
32-bit php_pdo_sqlsrv_71_ts.dll
7.1yes32-bit php7ts.dll
64-bit php_sqlsrv_71_nts.dll
64-bit php_pdo_sqlsrv_71_nts.dll
7.1no64-bit php7.dll
64-bit php_sqlsrv_71_ts.dll
64-bit php_pdo_sqlsrv_71_ts.dll
7.1yes64-bit php7ts.dll
32-bit php_sqlsrv_72_nts.dll
32-bit php_pdo_sqlsrv_72_nts.dll
7.2no32-bit php7.dll
32-bit php_sqlsrv_72_ts.dll
32-bit php_pdo_sqlsrv_72_ts.dll
7.2yes32-bit php7ts.dll
64-bit php_sqlsrv_72_nts.dll
64-bit php_pdo_sqlsrv_72_nts.dll
7.2no64-bit php7.dll
64-bit php_sqlsrv_72_ts.dll
64-bit php_pdo_sqlsrv_72_ts.dll
7.2yes64-bit php7ts.dll

On Linux, the following versions of the driver are included:

Driver filePHP versionThread safe?
php_sqlsrv_7_nts.so
php_pdo_sqlsrv_7_nts.so
7.0no
php_sqlsrv_7_ts.so
php_pdo_sqlsrv_7_ts.so
7.0yes
php_sqlsrv_71_nts.so
php_pdo_sqlsrv_71_nts.so
7.1no
php_sqlsrv_71_ts.so
php_pdo_sqlsrv_71_ts.so
7.1yes
php_sqlsrv_72_nts.so
php_pdo_sqlsrv_72_nts.so
7.2no
php_sqlsrv_72_ts.so
php_pdo_sqlsrv_72_ts.so
7.2yes

Microsoft Odbc Driver 11 For Sql Server Unexpected Eof Encountered In Bcp Data-file

Microsoft Drivers 4.3 for PHP for SQL Server:

On Windows, the following versions of the driver are included:

Driver filePHP versionThread safe?Use with PHP .dll
32-bit php_sqlsrv_7_nts.dll
32-bit php_pdo_sqlsrv_7_nts.dll
7.0no32-bit php7.dll
32-bit php_sqlsrv_7_ts.dll
32-bit php_pdo_sqlsrv_7_ts.dll
7.0yes32-bit php7ts.dll
64-bit php_sqlsrv_7_nts.dll
64-bit php_pdo_sqlsrv_7_nts.dll
7.0no64-bit php7.dll
64-bit php_sqlsrv_7_ts.dll
64-bit php_pdo_sqlsrv_7_ts.dll
7.0yes64-bit php7ts.dll
32-bit php_sqlsrv_71_nts.dll
32-bit php_pdo_sqlsrv_71_nts.dll
7.1no32-bit php7.dll
32-bit php_sqlsrv_71_ts.dll
32-bit php_pdo_sqlsrv_71_ts.dll
7.1yes32-bit php7ts.dll
64-bit php_sqlsrv_71_nts.dll
64-bit php_pdo_sqlsrv_71_nts.dll
7.1no64-bit php7.dll
64-bit php_sqlsrv_71_ts.dll
64-bit php_pdo_sqlsrv_71_ts.dll
7.1yes64-bit php7ts.dll

On Linux, the following versions of the driver are included:

Driver filePHP versionThread safe?
php_sqlsrv_7_nts.so
php_pdo_sqlsrv_7_nts.so
7.0no
php_sqlsrv_7_ts.so
php_pdo_sqlsrv_7_ts.so
7.0yes
php_sqlsrv_71_nts.so
php_pdo_sqlsrv_71_nts.so
7.1no
php_sqlsrv_71_ts.so
php_pdo_sqlsrv_71_ts.so
7.1yes

Microsoft Drivers 4.0 for PHP for SQL Server:

On Windows, the following versions of the driver are included:

Driver filePHP versionThread safe?Use with PHP .dll
php_sqlsrv_7_nts_x86.dll
php_pdo_sqlsrv_7_nts_x86.dll
7.0no32-bit php7.dll
php_sqlsrv_7_ts_x86.dll
php_pdo_sqlsrv_7_ts_x86.dll
7.0yes32-bit php7ts.dll
php_sqlsrv_7_nts_x64.dll
php_pdo_sqlsrv_7_nts_x64.dll
7.0no64-bit php7.dll
php_sqlsrv_7_ts_x64.dll
php_pdo_sqlsrv_7_ts_x64.dll
7.0yes64-bit php7ts.dll

On Linux, the following versions of the driver are included:

Driver filePHP versionThread safe?
php_sqlsrv_7_nts.so
php_pdo_sqlsrv_7_nts.so
7.0no
php_sqlsrv_7_ts.so
php_pdo_sqlsrv_7_ts.so
7.0yes

Microsoft Drivers 3.2 for PHP for SQL Server:

On Windows, the following versions of the driver are included:

Install Microsoft Odbc Driver 11 For Sql Server

Driver filePHP versionThread safe?Use with PHP .dll
php_sqlsrv_54_nts.dll
php_pdo_sqlsrv_54_nts.dll
5.4nophp5.dll
php_sqlsrv_54_ts.dll
php_pdo_sqlsrv_54_ts.dll
5.4yesphp5ts.dll
php_sqlsrv_55_nts.dll
php_pdo_sqlsrv_55_nts.dll
5.5nophp5.dll
php_sqlsrv_55_ts.dll
php_pdo_sqlsrv_55_ts.dll
5.5yesphp5ts.dll
php_sqlsrv_56_nts.dll
php_pdo_sqlsrv_56_nts.dll
5.6nophp5.dll
php_sqlsrv_56_ts.dll
php_pdo_sqlsrv_56_ts.dll
5.6yesphp5ts.dll

Microsoft Drivers 3.1 for PHP for SQL Server:

On Windows, the following versions of the driver are included:

Driver filePHP versionThread safe?Use with PHP .dll
php_sqlsrv_54_nts.dll
php_pdo_sqlsrv_54_nts.dll
5.4nophp5.dll
php_sqlsrv_54_ts.dll
php_pdo_sqlsrv_54_ts.dll
5.4yesphp5ts.dll
php_sqlsrv_55_nts.dll
php_pdo_sqlsrv_55_nts.dll
5.5nophp5.dll
php_sqlsrv_55_ts.dll
php_pdo_sqlsrv_55_ts.dll
5.5yesphp5ts.dll

See Also

Active1 year, 2 months ago

I am using PHP 5.6.35, and I have downloaded and installed/enabled the Microsoft SQL Server Drivers for PHP. Specifically, the ones below

extension=php_pdo_sqlsrv_56_nts.dll
extension=php_sqlsrv_56_nts.dll

Microsoft Odbc Driver 11 For Sql Server

I can see that they are enabled properly looking at the phpinfo() output. It shows both pdo_sqlsrv as enabled as well as sqlsrv support. However, when I try to connect to my database I get the following error back.

This extension requires the Microsoft 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

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified )

So, I assumed I needed to download the ODBC Driver 11 for SQL Server. So I downloaded what I thought was the correct file from here.

Sql Server Native Client 11 Driver

But when I try to install the driver I get an error stating that the installation of this product failed because it is not supported on this operating system. I'm running PHP 5.6.35 on Windows Server 2016.

Microsoft Odbc Driver 11 For Sql Server

HELP?

Microsoft Odbc Driver 11 For Sql ServerPhilPhil
1,7591 gold badge39 silver badges83 bronze badges

1 Answer

Use the x64 install file. I ran into the same issue and was able to add the 32 bit driver from the x64 installation. I have a 64 bit processors and I tried to test the 32 bit install file for implementation on the x86 systems and seen the same error.

vieyravieyra
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged phpsql-serverpdosqlsrv or ask your own question.