Skip to content

Instantly share code, notes, and snippets.

@sseidenthal
Last active September 14, 2018 17:43
Show Gist options
  • Save sseidenthal/f0fed61abc2d98b36f8a93388d72b9a3 to your computer and use it in GitHub Desktop.
Save sseidenthal/f0fed61abc2d98b36f8a93388d72b9a3 to your computer and use it in GitHub Desktop.
Install multiple versions off PHP on a Mac
# you can repeat this for any version of PHP available in brew
# adding needed taps
brew tap homebrew/php
brew tap homebrew/homebrew-php
# install php56 + mongodb and unlinking it
brew install php56
brew install homebrew/php/php56-mongodb
brew unlink php56
# install php70 + mongodb and unlinking it
brew install php70
brew install homebrew/php/php70-mongodb
brew unlink php70
# install php71 + mongodb and unlinking it
brew install php71
brew install homebrew/php/php71-mongodb
brew unlink php71
#install php-version, a tool to fast switch versions
brew install php-version
#If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
#~/.zshrc, ~/.profile or your shell's equivalent configuration file:
#This will enable php-version tool and set the default verion to 7.0.x (you can change the version of course)
source $(brew --prefix php-version)/php-version.sh && php-version 7.0
@sseidenthal
Copy link
Author

looks like this is deprecated now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment