Skip to content

Instantly share code, notes, and snippets.

@thetwopct
Created July 1, 2021 11:32
Show Gist options
  • Save thetwopct/fb0772620b0b7f319e48addcc6afd267 to your computer and use it in GitHub Desktop.
Save thetwopct/fb0772620b0b7f319e48addcc6afd267 to your computer and use it in GitHub Desktop.
Change PHP version on MacOS with Home Brew
# show php version i.e. 7.3.8
php -v
# update brew to latest
brew update
# to show all php versions available i.e. [email protected]
brew search php
# install it
brew install [email protected]
# it will tell you to run some commands suited to your system i.e.
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc
# close your terminal window and open a new one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment