Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danielnunez/9e9577cfd9672ecb5757f9127954ea7e to your computer and use it in GitHub Desktop.
Save danielnunez/9e9577cfd9672ecb5757f9127954ea7e to your computer and use it in GitHub Desktop.
MacOS install PHP Sqlsrv driver steps

Install build tools:

https://docs.microsoft.com/zh-tw/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-2017#installing-the-drivers-on-macos-el-capitan-sierra-and-high-sierra

brew install autoconf automake libtool

Then install PECL:

https://jasonmccreary.me/articles/install-pear-pecl-mac-os-x//

curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar

Install sqlsrv driver

sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv

If you get make Failed error, install unixodbc first.

brew install unixodbc

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment