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:
- Git — Distributed version control system
- Oh My Zsh — Framework for managing Zsh terminal configurations
- Homebrew — The package manager for MacOS
- 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 https://raw.github.com/risan/brew-php-switch/master/install.sh)"
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:
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