Last active
September 24, 2020 03:23
-
-
Save rezuankassim/de31e078dee0b9daddea6772c855334b to your computer and use it in GitHub Desktop.
script to change php version easily using brew and valet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
source ~/.phpv.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment