It is super easy to switch freely between multiple versions of php on mac
Brew PHP switcher is a simple script to quickly switch your CLI configuration between major versions of PHP.
If you have multiple products/projects built with new or old PHP features and find it painful to keep changing configuration files, PHP switcher is a simple command-line for switching between PHP versions.
For OSX users who installed PHP via Homebrew, only for PHP versions 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, and 8.0.
If you do not have multiple versions of the app installed, you can use the following command to install
brew install [email protected]
Apache's configuration must comment out native osx PHP modules
#LoadModule php5_module libexec/apache2/libphp5.so
brew install brew-php-switcher
Switch versions, if the other version directly uses 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 or 8.0, depending on the desired version.