Skip to content
💇 Shell script for switching between homebrew PHP version.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Brew PHP Switch

Brew PHP switch is shell script for switching Homebrew PHP versions.

Table of Contents


Before installing Brew PHP Switch, make sure you have installed all of the followings packages:

  1. Git — Distributed version control system
  2. Oh My Zsh — Framework for managing Zsh terminal configurations
  3. Homebrew — The package manager for MacOS
  4. Homebrew PHP — Install PHP with Homebrew


To install Brew PHP Switch, simply open up your terminal application and paste the following command:

sh -c "$(curl -fsSL"

Once it's completed, your Brew PHP Switch installation will be found on ~/.brew-php-switch directory. Next, you may want to reload your .zshrc file to get the latest PATH variable:

source ~/.zshrc

Switching PHP Version

Once Brew PHP Switch is installed, you can easily switch between PHP versions:

# Switch to PHP 7.1
phpswitch 71

# or switch to PHP 5.6
phpswitch 56
You can’t perform that action at this time.