Install PHP 7 with Homebrew:
brew install [email protected]
Symlink the formula:
brew link --force --overwrite [email protected]
Start the service:
brew services start [email protected]
Export the path if you’re using Zsh:
echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc
Or export the path if you’re using Bash:
echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"' >> ~/.bashrc
See Gist: