- 
      
- 
        Save joecampo/fe2e018528881c8d178e3666bca068c2 to your computer and use it in GitHub Desktop. 
Revisions
- 
        bubba-h57 revised this gist Oct 5, 2023 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # PHP Extensions sqlsrv & pdo_sqlsrv on Apple M1 ARM64 ## Install brew If you do not already have it, install brew as follows: ```bash 
- 
        bubba-h57 created this gist Oct 5, 2023 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ ## Install brew If you do not already have it, install brew as follows: ```bash /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` ## Install the GNU make tools ```bash brew install autoconf automake libtool ``` ## Install PHP If you do not already have it, install php as follows: ```bash 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): ```bash export PATH="/opt/homebrew/bin:$PATH" ``` ## Install Microsoft ODBC 18 ```bash 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 ```bash 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: - https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver16#installing-on-macos - https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/install-microsoft-odbc-driver-sql-server-macos?view=sql-server-ver16