Skip to content

Instantly share code, notes, and snippets.

@joecampo
Forked from bubba-h57/install.md
Created January 21, 2025 13:36
Show Gist options
  • Save joecampo/fe2e018528881c8d178e3666bca068c2 to your computer and use it in GitHub Desktop.
Save joecampo/fe2e018528881c8d178e3666bca068c2 to your computer and use it in GitHub Desktop.

Revisions

  1. @bubba-h57 bubba-h57 revised this gist Oct 5, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install.md
    Original 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
  2. @bubba-h57 bubba-h57 created this gist Oct 5, 2023.
    41 changes: 41 additions & 0 deletions install.md
    Original 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