Skip to content

Instantly share code, notes, and snippets.

@asika32764
Last active March 20, 2024 14:55
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save asika32764/2f62aa03b547570a478e9b55e6f8fec6 to your computer and use it in GitHub Desktop.
Save asika32764/2f62aa03b547570a478e9b55e6f8fec6 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