Home  >  Article  >  Backend Development  >  How to switch php version on Mac

How to switch php version on Mac

小云云
小云云Original
2018-01-18 09:10:295192browse

This article mainly shares with you the method of switching php version on Mac, I hope it can help you.

1. Use brew to install multiple php versions


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

2. Installation switching Tool

brew install php-versionsource $(brew --prefix php-version)/php-version.sh

3. View all currently installed versions

Does not include the local version, only shows the version installed by brew

php-version5.5.67.0.27

4.Switch version

php-version 5.5.6

You can switch the local php version to the required version through the above command

1. Use brew to install multiple php versions

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

2. Install the switching tool

brew install php-versionsource $(brew --prefix php-version)/php-version.sh

3. View all currently installed versions

does not include the local version, only the version installed by brew

php-version5.5.67.0.27

4. Switch version

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn