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

README.md

Brew PHP Switch

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

Table of Contents

Requirements

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

Installation

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:

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.