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

Dev #787

Merged
merged 131 commits into from
May 30, 2018
Merged

Dev #787

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
4740ed2
Fix issue 705 by including the possible negative sign
yitam Apr 2, 2018
54c0f5a
Fixed output to test
david-puglielli Apr 4, 2018
88f0bcf
Added bigint into the options
yitam Apr 4, 2018
a8db024
Merge pull request #737 from david-puglielli/pdo_utf8_conn-test-fix
david-puglielli Apr 4, 2018
dd58240
Merge pull request #732 from yitam/issue705
yitam Apr 4, 2018
72a1027
Merge pull request #740 from Microsoft/master
david-puglielli Apr 5, 2018
761c03e
Fixed test again
david-puglielli Apr 5, 2018
f15a3f8
Fixed test again
david-puglielli Apr 5, 2018
fafb7f4
Merge pull request #741 from david-puglielli/pdo_utf8_conn-test-fix
david-puglielli Apr 6, 2018
812db3d
Increase LAST_INSERT_ID_BUFF_LEN for other data types for identity co…
yitam Apr 6, 2018
dd64980
Merge pull request #742 from yitam/issue735
yitam Apr 6, 2018
2960738
Reverted change handling bigint output parameters
david-puglielli Apr 10, 2018
8c681f2
Updated failing tests
david-puglielli Apr 11, 2018
99a11c1
Fixed binary test
david-puglielli Apr 11, 2018
bbf951c
Minor fixes
david-puglielli Apr 11, 2018
454bc27
Merge pull request #744 from david-puglielli/Revert-bigint-change
david-puglielli Apr 11, 2018
2f8b9c2
Fix bigint output param test
yitam Apr 11, 2018
b8d1feb
Modified the driver tests as well
yitam Apr 12, 2018
c87e37f
Merge pull request #746 from yitam/BIGINTs
yitam Apr 12, 2018
93b9938
Replace most strlen with strnlen_s
yitam Apr 13, 2018
7a531d9
Merge pull request #747 from yitam/strlen
yitam Apr 16, 2018
9c78b1e
Modified the new issue template
yitam Apr 20, 2018
6365fbb
Workaround for pip install + ODBC 17 in windows
yitam Apr 20, 2018
c553105
Further simplified the issue template
yitam Apr 20, 2018
b34d5bd
Merge pull request #752 from yitam/template
yitam Apr 20, 2018
7a3d698
Modify buildscripts to configure php.ini
yitam Apr 20, 2018
16e0b89
Merge pull request #753 from yitam/phpini
yitam Apr 20, 2018
6b6500f
Use latest build scripts for testing with php 7.2
yitam Apr 20, 2018
d54f703
Debugging some more
yitam Apr 20, 2018
a548fcb
Tried not to rename the extensions
yitam Apr 23, 2018
dc95256
why empty coverage
yitam Apr 23, 2018
ac5064a
keep trying
yitam Apr 23, 2018
806c663
used full path for modules
yitam Apr 23, 2018
0169ec7
Tried other things
yitam Apr 23, 2018
3dbacb8
Try a shorter path
yitam Apr 24, 2018
714ea0f
Cleaning up to double check
yitam Apr 24, 2018
bdecae6
Switched the builder image
yitam Apr 24, 2018
4d9cc3c
Removed the wrong yml file
yitam Apr 24, 2018
246824a
Use the latest SQL Server
yitam Apr 24, 2018
72ca1cd
Fixed incorrect error when binding inout PDO STR with binary encoding
yitam Apr 24, 2018
3033a26
Added a comment to address the issue
yitam Apr 25, 2018
218497c
Made changes to output param handling code to convert doubles to ints…
yitam Apr 25, 2018
f4436d0
Merge pull request #757 from yitam/php72
yitam Apr 26, 2018
5b6b6f8
Merge branch 'dev' into vso2823
yitam Apr 26, 2018
5bb3f1a
Modified the error message to indicate value out of range
yitam Apr 26, 2018
5f6c399
A huge negative number is out of range too
yitam Apr 26, 2018
2fc3afe
Added a new test for issue 707
yitam Apr 27, 2018
06e9297
Use helper method isAEQualified instead
yitam Apr 30, 2018
440636a
Merge pull request #759 from yitam/vso2829
yitam May 1, 2018
04fa748
Added new tests for issue 678
yitam May 1, 2018
4a51049
Fixed one skipif
yitam May 1, 2018
5f99983
Use python -m pip instead
yitam May 1, 2018
1246864
Added --user
yitam May 2, 2018
991d776
Reverted -- user flag not working
yitam May 2, 2018
5f555df
Modified the expected results for a bind column test
yitam May 2, 2018
25f8590
Removed the workaround in a decimal test because issue 706 has been f…
yitam May 2, 2018
31685c4
Added another test for issue 699
yitam May 2, 2018
977e530
Support for Azure Key Vault
david-puglielli May 6, 2018
52cd004
Removed unnecessary comments
david-puglielli May 6, 2018
2fe0b5a
Removed more unnecessary comments
david-puglielli May 6, 2018
dde0e23
Merge pull request #764 from yitam/issue678
yitam May 7, 2018
f49da62
Added AKV configuration to setup files
david-puglielli May 7, 2018
55ae086
Skip test 699 in Linux for now
yitam May 7, 2018
39056d9
Removed output param test for now
yitam May 8, 2018
5a842c9
Merge pull request #761 from yitam/vso2823
yitam May 8, 2018
fb1a2ec
Changes according to PR review comments
david-puglielli May 8, 2018
5f62186
Updated Apache instructions, install order, fixed links
david-puglielli May 8, 2018
364fef6
Changes according to PR comments
david-puglielli May 8, 2018
2aaae26
Minor fixes
david-puglielli May 9, 2018
3b94eb4
Merging
david-puglielli May 9, 2018
f835447
Merge pull request #770 from david-puglielli/readme-apache-update
david-puglielli May 9, 2018
3cb84ee
Tests updated
david-puglielli May 9, 2018
b98b129
Tests updated
david-puglielli May 9, 2018
0bc4a36
Added test case for Issue 699
yitam May 14, 2018
2239511
Workaround for error returned in Linux
david-puglielli May 14, 2018
999312b
Tried using INT_MAX instead
yitam May 15, 2018
9a82e9d
Used sizeof not INT_MAX
yitam May 15, 2018
63c85ed
Merge pull request #765 from yitam/decimalTests
yitam May 15, 2018
bca3110
Modified the output param initial value
yitam May 15, 2018
4c7c085
Added workaround for the test plus use BIGINT for 64-bit systems
yitam May 15, 2018
0b5ceb0
Reverted the changes
yitam May 15, 2018
4747537
Fixed the formatting
yitam May 15, 2018
0a11136
Modified the test to address VSO 2915
yitam May 15, 2018
c56fb30
Changelog for 5.2.1-preview
yitam May 16, 2018
ebd7827
Fixed the links
yitam May 16, 2018
3d51d76
Fixed one more link
yitam May 16, 2018
079c4ea
Fixed tests, fixed wide char name in keystore struct
david-puglielli May 16, 2018
30a9708
Merge pull request #774 from yitam/vso2915
yitam May 16, 2018
196fe49
Merge pull request #773 from yitam/Issue699Test
yitam May 17, 2018
6eb96d9
Merge branch 'dev' into changelog
yitam May 17, 2018
e2b48df
Updated change log based on review
yitam May 17, 2018
85bda81
Skipping Ubuntu on verification akv tests
david-puglielli May 17, 2018
a0ade5d
Fixed connect_driver tests
david-puglielli May 17, 2018
64e2241
Extend output buffer sizes with SQL decimals or numerics
yitam May 17, 2018
eaa9446
Workaround for 32-bit error
david-puglielli May 17, 2018
757a84f
Added constant for AKV name
david-puglielli May 17, 2018
84f0168
Merge pull request #775 from yitam/vso2913
yitam May 18, 2018
10ea928
Fixed coding style
david-puglielli May 18, 2018
e2ed131
Final style fixes
david-puglielli May 18, 2018
e0f9afa
Merge pull request #768 from david-puglielli/azure-key-vault-support
david-puglielli May 18, 2018
05833bf
Modified BVT stream tests to make them more robust
yitam May 23, 2018
13e69b5
Fixed bigint insertion bug in x86
david-puglielli May 23, 2018
1b98036
Added unset to free conns/stmts
david-puglielli May 23, 2018
1edd16d
made bigint string for x64 too
david-puglielli May 24, 2018
5c46d4b
Merge pull request #777 from david-puglielli/bigint-x86-test-fix
david-puglielli May 24, 2018
f0eefaf
Merge pull request #776 from yitam/streamTests
yitam May 24, 2018
4c06237
Added a couple more fixes and elaborated some comments
yitam May 24, 2018
8356b15
Fixed some typos
yitam May 24, 2018
d26440b
Modified version.h for 5.2.1-preview
yitam May 24, 2018
cee6370
Split akv verification tests to fix SSL issue
david-puglielli May 25, 2018
8f5c706
Corrected the expected output
yitam May 25, 2018
6817c7b
Modified the comments to clarify things
yitam May 25, 2018
9e8d674
Fixed the bvt streams tests
yitam May 25, 2018
997e80c
Added High Sierra and modified the macOS instructions
yitam May 25, 2018
3c405f4
Shifted NOTES
yitam May 25, 2018
bd9d85b
Refactored some akv tests, other small changes
david-puglielli May 25, 2018
1747df1
addressed review comments
david-puglielli May 25, 2018
ff0e460
dropped tables at end
david-puglielli May 25, 2018
0861f06
Merge pull request #781 from david-puglielli/akv-verification-test-fix
david-puglielli May 25, 2018
c676ae0
Addressed review comments
yitam May 25, 2018
fbd686c
Merge pull request #782 from yitam/FixStreamTests
yitam May 25, 2018
45f422a
Merge pull request #780 from yitam/version
yitam May 25, 2018
d35575b
Added select type conversion test and updated values
david-puglielli May 26, 2018
c348aad
Addressed review comments
david-puglielli May 28, 2018
13144d9
Merge pull request #783 from david-puglielli/type-conversion-for-ae
david-puglielli May 28, 2018
b7a9ec6
Check if returned error is empty first before using count()
yitam May 29, 2018
99b91f8
Merge pull request #784 from yitam/fixCount
yitam May 29, 2018
9e75dfe
Merge pull request #779 from yitam/changelog
yitam May 29, 2018
b128820
Fixed akv test failures with win encryption
david-puglielli May 29, 2018
9d1eafd
Fixed encryption check
david-puglielli May 29, 2018
4509756
Merge pull request #785 from david-puglielli/ae-test-experiments
david-puglielli May 30, 2018
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
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,41 @@ All notable changes to this project will be documented in this file.

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

## Windows/Linux/macOS 5.2.0 - 2017-02-14
## 5.2.1-preview - 2018-06-01
Updated PECL release packages. Here is the list of updates:

### Added
- Added support for Azure Key Vault for Always Encrypted for basic CRUD functionalities such that Always Encrypted feature is also available to Linux or macOS users
- Added support for macOS High Sierra (requires [MS ODBC Driver 17+](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017))

### Fixed
- Issue [#577](https://github.com/Microsoft/msphpsql/issues/577) - Idle Connection Resiliency doesn't work with Column Encryption enabled connection
- Issue [#678](https://github.com/Microsoft/msphpsql/issues/678) - Idle Connection Resiliency doesn't work with Connection Pooling bug
- Issue [#699](https://github.com/Microsoft/msphpsql/issues/699) - Binding output parameter failed when the query in the stored procedure returned no data. The test case has been added to the test lab.
- Issue [#705](https://github.com/Microsoft/msphpsql/issues/705) - AE - Retrieving a negative decimal value (edge case) as output parameter causes truncation
- Issue [#706](https://github.com/Microsoft/msphpsql/issues/706) - AE - Cannot insert double with precision and scale (38, 38)
- Issue [#707](https://github.com/Microsoft/msphpsql/issues/707) - AE - Fetching decimals / numerics as output parameters bound to PDO::PARAM_BOOL or PDO::PARAM_INT returns floats, not integers
- Issue [#735](https://github.com/Microsoft/msphpsql/issues/735) - Extended the buffer size for PDO lastInsertId such that data types other than integers can be supported
- Pull Request [#759](https://github.com/Microsoft/msphpsql/pull/759) - Removed the limitation of binding a binary as inout param as PDO::PARAM_STR with SQLSRV_ENCODING_BINARY
- Pull Request [#775](https://github.com/Microsoft/msphpsql/pull/775) - Fixed the problem for output params with SQL types specified as SQLSRV_SQLTYPE_DECIMAL or SQLSRV_SQLTYPE_NUMERIC

### Limitations
- No support for inout / output params when using sql_variant type
- In Linux and macOS, setlocale() only takes effect if it is invoked before the first connection. Attempting to set the locale after connection will not work
- Always Encrypted feature, which requires [MS ODBC Driver 17+](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017)
- only Windows Certificate Store and Azure Key Vault are supported
- Issue [#716](https://github.com/Microsoft/msphpsql/issues/716) - With Always Encrypted feature enabled, Named Parameters in Sub Queries are not supported
- [Always Encrypted limitations](https://docs.microsoft.com/en-us/sql/connect/php/using-always-encrypted-php-drivers?view=sql-server-2017#limitations-of-the-php-drivers-when-using-always-encrypted)

### Known Issues
- Connection pooling on Linux or macOS not recommended with [unixODBC](http://www.unixodbc.org/) < 2.3.6
- 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
- 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)
- With ColumnEncryption enabled, calling stored procedures with XML parameters does not work (Issue [#674](https://github.com/Microsoft/msphpsql/issues/674))


## Windows/Linux/macOS 5.2.0 - 2018-03-23
Updated PECL release packages. Here is the list of updates:

### Added
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-msphpsql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && ACCEPT_EULA=Y apt
ENV PATH="/opt/mssql-tools/bin:${PATH}"

#install coveralls
RUN pip install --upgrade pip && pip install cpp-coveralls
RUN python -m pip install --upgrade pip && pip install cpp-coveralls

#Either Install git / download zip (One can see other strategies : https://ryanfb.github.io/etc/2015/07/29/git_strategies_for_docker.html )
#One option is to get source from zip file of repository.
Expand Down
81 changes: 45 additions & 36 deletions Linux-mac-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ These instruction install PHP 7.2 by default -- see the notes at the beginning o
- [Installing the drivers on Red Hat 7](#installing-the-drivers-on-red-hat-7)
- [Installing the drivers on Debian 8 and 9](#installing-the-drivers-on-debian-8-and-9)
- [Installing the drivers on Suse 12](#installing-the-drivers-on-suse-12)
- [Installing the drivers on macOS El Capitan and Sierra](#installing-the-drivers-on-macos-el-capitan-and-sierra)
- [Installing the drivers on macOS El Capitan, Sierra and High Sierra](#installing-the-drivers-on-macos-el-capitan-sierra-and-high-sierra)

## Installing the drivers on Ubuntu 16.04 and 17.10

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

### Step 1. Install PHP
```
Expand All @@ -28,12 +28,12 @@ Install the ODBC driver for Ubuntu by following the instructions on the [Linux a

### Step 3. Install the PHP drivers for Microsoft SQL Server
```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
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
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
```
### Step 4. Install Apache and configure driver loading
```
Expand All @@ -42,8 +42,8 @@ apt-get install libapache2-mod-php7.2 apache2
a2dismod mpm_event
a2enmod mpm_prefork
a2enmod php7.2
echo "extension=sqlsrv.so" >> /etc/php/7.2/apache2/php.ini
echo "extension=pdo_sqlsrv.so" >> /etc/php/7.2/apache2/php.ini
echo "extension=pdo_sqlsrv.so" >> /etc/php/7.2/apache2/conf.d/30-pdo_sqlsrv.ini
echo "extension=sqlsrv.so" >> /etc/php/7.2/apache2/conf.d/20-sqlsrv.ini
```
### Step 5. Restart Apache and test the sample script
```
Expand All @@ -53,8 +53,8 @@ To test your installation, see [Testing your installation](#testing-your-install

## Installing the drivers on Red Hat 7

> [!NOTE]
> To install PHP 7.0 or 7.1, replace remi-php72 with remi-php70 or remi-php71 respectively in the following commands.
> [!NOTE]
> To install PHP 7.0 or 7.1, replace remi-php72 with remi-php70 or remi-php71 respectively in the following commands.

### Step 1. Install PHP

Expand All @@ -79,12 +79,12 @@ 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 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
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
```
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:
```
Expand Down Expand Up @@ -116,8 +116,8 @@ To test your installation, see [Testing your installation](#testing-your-install

## Installing the drivers on Debian 8 and 9

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

### Step 1. Install PHP
```
Expand All @@ -126,7 +126,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.2 php7.2-dev php7.2-xml
apt-get install -y php7.2 php7.2-dev php7.2-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/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
Expand All @@ -140,12 +140,12 @@ locale-gen

### Step 3. Install the PHP drivers for Microsoft SQL Server
```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
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
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
```
### Step 4. Install Apache and configure driver loading
```
Expand All @@ -154,8 +154,8 @@ apt-get install libapache2-mod-php7.2 apache2
a2dismod mpm_event
a2enmod mpm_prefork
a2enmod php7.2
echo "extension=sqlsrv.so" >> /etc/php/7.2/apache2/php.ini
echo "extension=pdo_sqlsrv.so" >> /etc/php/7.2/apache2/php.ini
echo "extension=pdo_sqlsrv.so" >> /etc/php/7.2/apache2/conf.d/30-pdo_sqlsrv.ini
echo "extension=sqlsrv.so" >> /etc/php/7.2/apache2/conf.d/20-sqlsrv.ini
```
### Step 5. Restart Apache and test the sample script
```
Expand All @@ -165,10 +165,10 @@ To test your installation, see [Testing your installation](#testing-your-install

## Installing the drivers on Suse 12

> [!NOTE]
> To install PHP 7.0, skip the command below adding the repository - 7.0 is the default PHP on suse 12.
> To install PHP 7.1, replace the repository URL below with the following URL:
`http://download.opensuse.org/repositories/devel:/languages:/php:/php71/SLE_12/devel:languages:php:php71.repo`
> [!NOTE]
> To install PHP 7.0, skip the command below adding the repository - 7.0 is the default PHP on suse 12.
> To install PHP 7.1, replace the repository URL below with the following URL:
`http://download.opensuse.org/repositories/devel:/languages:/php:/php71/SLE_12/devel:languages:php:php71.repo`

### Step 1. Install PHP
```
Expand All @@ -182,12 +182,12 @@ Install the ODBC driver for Suse 12 by following the instructions on the [Linux

### Step 3. Install the PHP drivers for Microsoft SQL Server
```
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
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
exit
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
```
### Step 4. Install Apache and configure driver loading
```
Expand All @@ -203,28 +203,30 @@ 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 El Capitan and Sierra
## Installing the drivers on macOS El Capitan, Sierra and High Sierra

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

> [!NOTE]
> To install PHP 7.0 or 7.1, replace php72 with php70 or php71 respectively in the following commands.
> [!NOTE]
> To install PHP 7.0 or 7.1, replace php@7.2 with php@7.0 or php@7.1 respectively in the following commands.

### Step 1. Install PHP

```
brew tap
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php72 --with-pear --with-httpd24 --with-cgi
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
brew tap homebrew/core
brew install php@7.2
```

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.2
```

### Step 2. Install prerequisites
Install the ODBC driver for macOS by following the instructions on the [Linux and macOS installation page](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).

Expand All @@ -235,13 +237,20 @@ brew install autoconf automake libtool

### Step 3. Install the PHP drivers for Microsoft SQL Server
```
chmod -R ug+w /usr/local/opt/php72/lib/php
pear config-set php_ini /usr/local/etc/php/7.2/php.ini system
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
```
### Step 4. Install Apache and configure driver loading
```
brew install apache2
```
To find the Apache configuration file for your Apache installation, run
```
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.2/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