Skip to content

Instantly share code, notes, and snippets.

@asika32764
Last active August 14, 2024 15:09
Show Gist options
  • 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

@mrl22
Copy link

mrl22 commented May 13, 2024

Thank you.

You are missing the S at the end of http in the URL, throws a 301 redirect.

@Aksoyhlc
Copy link

@mrl22
use https

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

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