Home > Backend Development > PHP Tutorial > How to switch php version on Mac

How to switch php version on Mac

小云云
Release: 2023-03-19 14:58:02
Original
5251 people have browsed it

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
Copy after login
Copy after login

Then use brew Installing multiple php versions

brew install php53
brew install php56
brew install php70
Copy after login
Copy after login

You may need the following commands during the process

brew unlink phpxx
Copy after login
Copy after login

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
Copy after login
Copy after login

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
Copy after login
Copy after login

4.Switch version

php-version 5.5.6
Copy after login
Copy after login

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
Copy after login
Copy after login

Then use brew to install multiple php versions

brew install php53
brew install php56
brew install php70
Copy after login
Copy after login

You may need the following commands during the process

brew unlink phpxx
Copy after login
Copy after login

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
Copy after login
Copy after login

3. View all currently installed versions

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

php-version5.5.67.0.27
Copy after login
Copy after login

4. Switch version

php-version 5.5.6
Copy after login
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template