Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1045121%22%20slang%3D%22en-US%22%3EMicrosoft%20Drivers%205.7.1%20Preview%20for%20PHP%20for%20SQL%20Server%20Released%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1045121%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20recently%20released%20the%20next%20preview%20of%20the%20Microsoft%20Drivers%20for%20PHP%20for%20SQL%20Server%2C%20version%205.7.1-preview.%20This%20preview%20release%20has%20been%20built%20with%20PHP%207.2%2B%20and%20tested%20on%20all%20supported%20platforms.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENotable%20items%20about%20this%20release%20include%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId-1056764473%22%20id%3D%22toc-hId-1056764473%22%3EAdded%3C%2FH3%3E%3CUL%3E%3CLI%3ESupport%20for%20PHP%207.4%3C%2FLI%3E%3CLI%3ESupport%20for%20Red%20Hat%208%20and%20macOS%20Catalina%20(10.15)%3C%2FLI%3E%3CLI%3EFeature%20Request%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Fissues%2F1018%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%231018%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-%20support%20for%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Fwiki%2FFeatures%23natlTypes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPHP%20extended%20string%20types%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-%20Pull%20Request%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Fpull%2F1043%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%231043%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Fwiki%2FFeatures%23alwaysencryptedV2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAlways%20Encrypted%20with%20secure%20enclaves%3C%2FA%3E%2C%20which%20requires%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Fconnect%2Fodbc%2Fdownload-odbc-driver-for-sql-server%3Fview%3Dsql-server-ver15%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMS%20ODBC%20Driver%2017.4%2B%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fsql-server%2Fsql-server-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQL%20Server%202019%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3CH3%20id%3D%22toc-hId--750689990%22%20id%3D%22toc-hId--750689990%22%3ERemoved%3C%2FH3%3E%3CUL%3E%3CLI%3EDropped%20support%20for%20PHP%207.1%3C%2FLI%3E%3C%2FUL%3E%3CH3%20id%3D%22toc-hId-1736822843%22%20id%3D%22toc-hId-1736822843%22%3EFixed%3C%2FH3%3E%3CUL%3E%3CLI%3EIssue%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Fissues%2F1027%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%231027%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-%20Fixed%20how%20drivers%20handle%20query%20timeout%20settings%3C%2FLI%3E%3CLI%3EPull%20Request%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Fpull%2F1049%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%231049%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-%20performance%20improvement%20for%20fetching%20from%20tables%20with%20many%20columns%20-%20cached%20the%20derived%20php%20types%20with%20column%20metadata%20to%20streamline%20data%20retrieval%3C%2FLI%3E%3C%2FUL%3E%3CH3%20id%3D%22toc-hId--70631620%22%20id%3D%22toc-hId--70631620%22%3E%26nbsp%3B%3C%2FH3%3E%3CH3%20id%3D%22toc-hId--1878086083%22%20id%3D%22toc-hId--1878086083%22%3ELimitations%3C%2FH3%3E%3CUL%3E%3CLI%3ENo%20support%20for%20inout%20%2F%20output%20params%20when%20using%20sql_variant%20type%3C%2FLI%3E%3CLI%3ENo%20support%20for%20inout%20%2F%20output%20params%20when%20formatting%20decimal%20values%3C%2FLI%3E%3CLI%3EIn%20Linux%20and%20macOS%2C%20setlocale()%20only%20takes%20effect%20if%20it%20is%20invoked%20before%20the%20first%20connection.%20Attempting%20to%20set%20the%20locale%20after%20connecting%20will%20not%20work%3C%2FLI%3E%3CLI%3EAlways%20Encrypted%20requires%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Fconnect%2Fodbc%2Flinux-mac%2Finstalling-the-microsoft-odbc-driver-for-sql-server%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMS%20ODBC%20Driver%2017%2B%3C%2FA%3E%3CUL%3E%3CLI%3EOnly%20Windows%20Certificate%20Store%20and%20Azure%20Key%20Vault%20are%20supported.%20Custom%20Keystores%20are%20not%20yet%20supported%3C%2FLI%3E%3CLI%3EIssue%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsphpsql%2Fissues%2F716%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%23716%3C%2FA%3E-%20With%20Always%20Encrypted%20enabled%2C%20named%20parameters%20in%20subqueries%20are%20not%20supported%3C%2FLI%3E%3CLI%3E%3CSPAN%3EIssue%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Fissues%2F1050%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%231050%3C%2FA%3E%3CSPAN%3E%26nbsp%3B-%20With%20Always%20Encrypted%20enabled%2C%20insertion%20requires%20the%20column%20list%20for%20any%20tables%20with%20identity%20columns%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Fconnect%2Fphp%2Fusing-always-encrypted-php-drivers%23limitations-of-the-php-drivers-when-using-always-encrypted%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAlways%20Encrypted%20limitations%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3CH3%20id%3D%22toc-hId-609426750%22%20id%3D%22toc-hId-609426750%22%3EKnown%20Issues%3C%2FH3%3E%3CUL%3E%3CLI%3EData%20Classification%20metadata%20retrieval%20requires%20ODBC%20Driver%2017.4.2.1%2B%20and%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fsql-server%2Fsql-server-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQL%20Server%202019%3C%2FA%3E%3C%2FLI%3E%3CLI%3EConnection%20pooling%20on%20Linux%20or%20macOS%20is%20not%20recommended%20with%20%3CA%20href%3D%22http%3A%2F%2Fwww.unixodbc.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EunixODBC%3C%2FA%3E%26lt%3B%202.3.7%3C%2FLI%3E%3CLI%3EWhen%20pooling%20is%20enabled%20in%20Linux%20or%20macOS%3CUL%3E%3CLI%3EunixODBC%20%26lt%3B%3D%202.3.4%20(Linux%20and%20macOS)%20might%20not%20return%20proper%20diagnostic%20information%2C%20such%20as%20error%20messages%2C%20warnings%20and%20informative%20messages%3C%2FLI%3E%3CLI%3Edue%20to%20this%20unixODBC%20bug%2C%20fetch%20large%20data%20(such%20as%20xml%2C%20binary)%20as%20streams%20as%20a%20workaround.%20See%20the%20examples%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsphpsql%2Fwiki%2FFeatures%23pooling%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3CLI%3EWith%20ColumnEncryption%20enabled%2C%20calling%20stored%20procedures%20with%20XML%20parameters%20does%20not%20work%20(Issue%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsphpsql%2Fissues%2F674%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%23674%3C%2FA%3E)%3C%2FLI%3E%3C%2FUL%3E%3CH3%20id%3D%22toc-hId--1198027713%22%20id%3D%22toc-hId--1198027713%22%3E%26nbsp%3B%3C%2FH3%3E%3CH3%20id%3D%22toc-hId-1289485120%22%20id%3D%22toc-hId-1289485120%22%3ESurvey%3C%2FH3%3E%3CP%3ELet%20us%20know%20how%20we%20are%20doing%20and%20how%20you%20use%20our%20drivers%20by%20taking%20our%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fmssqlphpsurvey%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Epulse%20survey%3C%2FA%3E.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CH3%20id%3D%22toc-hId--517969343%22%20id%3D%22toc-hId--517969343%22%3EInstall%3C%2FH3%3E%3CUL%3E%3CLI%3EOn%20Linux%20and%20macOS%20run%20the%20commands%20below%3A%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Esudo%20pecl%20install%20sqlsrv-5.7.1preview%0Asudo%20pecl%20install%20pdo_sqlsrv-5.7.1preview%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3ETo%20download%20Windows%20DLLs%20for%20PHP%207.2%20or%20above%20from%20the%20PECL%20repository%2C%20please%20navigate%20to%20%3CA%20href%3D%22https%3A%2F%2Fpecl.php.net%2Fpackage%2Fsqlsrv%2F5.7.0preview%2Fwindows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQLSRV%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fpecl.php.net%2Fpackage%2Fpdo_sqlsrv%2F5.7.0preview%2Fwindows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPDO_SQLSRV%3C%2FA%3E.%3C%2FLI%3E%3CLI%3EDirect%20downloads%20for%20released%20binaries%20can%20also%20be%20found%20at%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmsphpsql%2Freleases%2Ftag%2Fv5.7.1-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGithub%20release%20tag%3C%2FA%3E.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDavid%20Engel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1045121%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20recently%20released%20the%20next%20preview%20of%20the%20Microsoft%20Drivers%20for%20PHP%20for%20SQL%20Server%2C%20version%205.7.1-preview.%20This%20preview%20release%20has%20been%20built%20with%20PHP%207.2%2B%20and%20tested%20on%20all%20supported%20platforms.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1045121%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerDrivers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Senior Member

We recently released the next preview of the Microsoft Drivers for PHP for SQL Server, version 5.7.1-preview. This preview release has been built with PHP 7.2+ and tested on all supported platforms.

 

Notable items about this release include:

 

Added

Removed

  • Dropped support for PHP 7.1

Fixed

  • Issue #1027 - Fixed how drivers handle query timeout settings
  • Pull Request #1049 - performance improvement for fetching from tables with many columns - cached the derived php types with column metadata to streamline data retrieval

 

Limitations

  • No support for inout / output params when using sql_variant type
  • No support for inout / output params when formatting decimal values
  • In Linux and macOS, setlocale() only takes effect if it is invoked before the first connection. Attempting to set the locale after connecting will not work
  • Always Encrypted requires MS ODBC Driver 17+
    • Only Windows Certificate Store and Azure Key Vault are supported. Custom Keystores are not yet supported
    • Issue #716 - With Always Encrypted enabled, named parameters in subqueries are not supported
    • Issue #1050 - With Always Encrypted enabled, insertion requires the column list for any tables with identity columns
    • Always Encrypted limitations

Known Issues

  • Data Classification metadata retrieval requires ODBC Driver 17.4.2.1+ and SQL Server 2019
  • Connection pooling on Linux or macOS is not recommended with unixODBC < 2.3.7
  • When pooling is enabled in Linux or macOS
    • unixODBC <= 2.3.4 (Linux and macOS) might not return proper diagnostic information, such as error messages, warnings and informative messages
    • due to this unixODBC bug, fetch large data (such as xml, binary) as streams as a workaround. See the examples here
  • With ColumnEncryption enabled, calling stored procedures with XML parameters does not work (Issue #674)

 

Survey

Let us know how we are doing and how you use our drivers by taking our pulse survey.

 

Install

  • On Linux and macOS run the commands below:

 

 

 

sudo pecl install sqlsrv-5.7.1preview
sudo pecl install pdo_sqlsrv-5.7.1preview​

 

 

 

  • To download Windows DLLs for PHP 7.2 or above from the PECL repository, please navigate to SQLSRV or PDO_SQLSRV.
  • Direct downloads for released binaries can also be found at the Github release tag.

 

David Engel