Microsoft Drivers v4.3.0 for PHP for SQL Server released!

This post was authored by Meet Bhagdev, Program Manager, Microsoft

Hi all,

We are excited to announce the Production Ready release for the Microsoft Drivers v4.3.0 for PHP for SQL Server. The drivers now support Debian Jessie and macOS. The driver enables access to SQL Server, Azure SQL Database, and Azure SQL DW from any PHP application on Linux, Windows, and macOS.

Notable items for the release:

Added

Fixed

  • Fixed the assertion error (Linux) when fetching data from a binary column using the binary encoding (issue #226)
  • Fixed PECL installation errors when PHP was installed from source (issue #213)
  • Fixed issue output parameters bound to empty string (issue #182)
  • Fixed a memory leak in closing connection resources
  • Fixed load ordering issue in MacOS (issue #417)
  • Fixed the issue with driver loading order in macOS
  • Fixed null returned when an empty string is set to an output parameter (issue #308)
  • SQLSRV only
    • Fixed sqlsrv client buffer size to only allow positive integers (issue #228)
    • Fixed sqlsrv_num_rows() when the client buffered result is null (issue #330)
    • Fixed issues with sqlsrv_has_rows() to prevent it from moving statement cursor (issue #37)
    • Fixed conversion warnings because of some const chars (issue #332)
    • Fixed debug abort error when building the driver in debug mode with PHP 7.1
    • Fixed string truncation when binding varchar(max), nvarchar(max), varbinary(max), and xml types (issue #231)
    • Fixed fatal error when fetching empty nvarchar (issue #69)
    • Fixed fatal error when calling sqlsrv_fetch() with an out of bound offset for SQLSRV_SCROLL_ABSOLUTE (issue #223)
  • PDO_SQLSRV only
    • Fixed issue with SQLSRV_ATTR_FETCHES_NUMERIC_TYPE when column return type is set on statement (issue #173)
    • Improved performance by implementing a cache to store column SQL types and display sizes (issue #189)
    • Fixed segmentation fault with PDOStatement::getColumnMeta() when the supplied column index is out of range (issue #224)
    • Fixed issue with the unsupported attribute PDO::ATTR_PERSISTENT in connection (issue #65)
    • Fixed the issue with executing DELETE operation on a nonexistent value (issue #336)
    • Fixed incorrectly binding of unicode parameter when emulate prepare is on and the encoding is set at the statement level (issue #92)
    • Fixed binary column binding when emulate prepare is on (issue #140)
    • Fixed wrong value returned when fetching varbinary value on Linux (issue #270)
    • Fixed binary data not returned when the column is bound by name (issue #35)
    • Fixed exception thrown on closeCursor() when the statement has not been executed (issue #267)

Limitations

  • No support for input/output parameters when using sql_variant type

Known issue

  • When pooling is enabled in Linux or macOS
    • unixODBC <= 2.3.4 (Linux and macOS) might not return proper diagnostics information, such as error messages, warnings, and informative messages
    • Because of this unixODBC bug, fetch large data (such as xml, binary) as streams as a workaround. See the examples here.

Get started

Getting Drivers for PHP5 and older runtimes

You can download the Microsoft PHP Drivers for SQL Server for PHP 5.4, 5.5, and 5.6 from the download center: https://www.microsoft.com/en-us/download/details.aspx?id=20098. Version 3.0 supports PHP 5.4, version 3.1 supports PHP 5.4 and PHP 5.5, and version 3.2 supports PHP 5.4, 5.5, and 5.6.

PHP Driver Version Supported
v3.2 PHP 5.6, 5.5, 5.4
v3.1 PHP 5.5, 5.4
v3.1 PHP 5.4

Meet Bhagdev (meetb@microsoft.com)

msftlovesphp