MAC Environment to complete the switch between PHP versions, many times in local development we need multiple versions of the PHP development environment. Partners who are used to developing their own computers in the company are often forced to replace the PHP version with the company's online environment. But there is no need to reduce their PHP version, because I want to learn the latest PHP version of the new features. OK, so here's what we're going to do to solve the actual application problem:
The first thing we need to understand is the PHP software and PHP services two concepts:
Here we understand the two concepts above using different versions of the configuration.
First of all, we are using the Mac software management tools Brew, I believe this Mac small partners are not unfamiliar (to the novice a install brew address: https://brew.sh can switch language)
We first through the terminal my client view PHP version, the display is the PHP software version:
View the PHP version via browser phpinfo (), which shows the PHP service version:
Now I'm using brew to stop php5.6 service
Brew Services Stop PHP56
Open the php7.0 server
Brew Services Start PHP70
We will check the PHP version through the terminal my client, which shows the PHP software version:
Then view the PHP version via browser phpinfo (), which shows the PHP service version:
Stop the PHP56 server, start the PHP70 service, the system version or the Php5.6,phpinfo () is already the php7.0 version
So, how to switch the System software PHP version, this is more simple, through the brew remove php5.6 soft link, add php7.0 soft link, the command line is as follows:
Brew Unlink Php56
Unlinking/usr/local/cellar/php56/5.6.33_9 ... Symlinks removed
Brew Link Php70
Linking/usr/local/cellar/php70/7.0.27_19 ... Symlinks created
Finally, we will see the PHP version through the terminal my client, which shows the PHP software version:
OK, so that we can successfully complete the PHP software and service switch!
Related recommendations:
CENTOS7 upgrade PHP version to PHP7 instance sharing
Mac Switch PHP version method
Mac OS quick way to switch multiple PHP versions