brew install php@7.4
brew services restart php
brew unlink php@8.1
brew link php@7.4
echo 'export PATH="/usr/local/opt/php@7.4/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@7.4/sbin:$PATH"' >> ~/.zshrc
#php 5.6 is deprecated so to install it
brew tap exolnet/homebrew-deprecated
brew install php@5.6