Skip to content

Instantly share code, notes, and snippets.

@bubba-h57
Last active April 24, 2024 13:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save bubba-h57/7b01ef8882ca04b6b9dd552aa15aad8c to your computer and use it in GitHub Desktop.
Save bubba-h57/7b01ef8882ca04b6b9dd552aa15aad8c to your computer and use it in GitHub Desktop.
Instructions for installing PHP Extensions sqlsrv & pdo_sqlsrv on Apple M1 ARM64 workstations.

PHP Extensions sqlsrv & pdo_sqlsrv on Apple M1 ARM64

Install brew

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)"

Install the GNU make tools

brew install autoconf automake libtool

Install PHP

If you do not already have it, install php as follows:

brew tap
brew tap homebrew/core
brew install php@8.1

You probably need to set the path (and place it in your .zshrc or .profile):

export PATH="/opt/homebrew/bin:$PATH"

Install Microsoft ODBC 18

brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18

Install the PHP Drivers

sudo CXXFLAGS="-I/opt/homebrew/opt/unixodbc/include/" LDFLAGS="-L/opt/homebrew/lib/" pecl install sqlsrv
sudo CXXFLAGS="-I/opt/homebrew/opt/unixodbc/include/" LDFLAGS="-L/opt/homebrew/lib/" pecl install pdo_sqlsrv

References:

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