Home > Article > Backend Development > How to switch php version on Mac
This article mainly shares with you the method of switching php version on Mac, I hope it can help you.
First check the local php version through the command
php -v
Then use brew Installing multiple php versions
brew install php53 brew install php56 brew install php70
You may need the following commands during the process
brew unlink phpxx
Commands like this can help us quickly install alternative php versions
brew install php-versionsource $(brew --prefix php-version)/php-version.sh
Does not include the local version, only shows the version installed by brew
php-version5.5.67.0.27
php-version 5.5.6
You can switch the local php version to the required version through the above command
First check the local php version through the command
php -v
Then use brew to install multiple php versions
brew install php53 brew install php56 brew install php70
You may need the following commands during the process
brew unlink phpxx
Commands like this can help us quickly install alternative php versions
brew install php-versionsource $(brew --prefix php-version)/php-version.sh
does not include the local version, only the version installed by brew
php-version5.5.67.0.27
php-version 5.5.6
You can switch the local php version to the required version through the above command
Related recommendations:
Freely modify phpstudy PHP version method
Detailed explanation of how to upgrade PHP version under Windows server
How to quickly switch between multiple PHP versions under mac
The above is the detailed content of How to switch php version on Mac. For more information, please follow other related articles on the PHP Chinese website!