Skip to content

PHP Help

Switching PHP versions on your local machine is easy using brew.

  1. Find current PHP version

    Terminal window
    php -v
  2. Unlink current version

    Terminal window
    brew unlink php
    # or
    brew unlink php@version #e.g. brew unlink php@7.4
  3. Install the desired version using brew

    Terminal window
    brew install php@version #e.g. brew install php@7.4
  4. Link the desired version

    Terminal window
    brew link php@version #e.g. brew link php@7.4
  5. Verify the version is now linked

    Terminal window
    php -v