Skip to content

Instantly share code, notes, and snippets.

@rezuankassim
Last active September 24, 2020 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rezuankassim/de31e078dee0b9daddea6772c855334b to your computer and use it in GitHub Desktop.
Save rezuankassim/de31e078dee0b9daddea6772c855334b to your computer and use it in GitHub Desktop.
script to change php version easily using brew and valet
phpv() {
valet stop
brew unlink php@7.0
brew unlink php@7.2
brew unlink php
brew link --force --overwrite $1
brew services stop php@7.0
brew services stop php@7.2
brew services stop php
brew services start $1
composer global update
rm -f ~/.config/valet/valet.sock
valet install
}
alias php70="phpv php@7.0"
alias php72="phpv php@7.2"
alias php74="phpv php"
...
source ~/.phpv.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment