Skip to content

Instantly share code, notes, and snippets.

@bubba-h57
Last active September 28, 2024 23:32
Show Gist options
  • 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 [email protected]

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