Skip to content

Instantly share code, notes, and snippets.

@r1tt3r
Created January 27, 2021 16:36
Show Gist options
  • Save r1tt3r/e0f199eb274d5ff186b73956af594316 to your computer and use it in GitHub Desktop.
Save r1tt3r/e0f199eb274d5ff186b73956af594316 to your computer and use it in GitHub Desktop.
switch-php() {
valet stop
brew unlink [email protected] [email protected] [email protected]
brew link --force --overwrite php@$1
brew services restart php@$1
composer global update
rm -f ~/.config/valet/valet.sock
valet install
}
@infostreams
Copy link

Alternative for the brew unlink line:

brew list --formula -1 | grep php | grep @ | xargs brew unlink

This will unlink all php versions you have installed, without manually having to list them all.

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