1. Install different versions of PHP
(Recommended learning: PHP video tutorial)
# brew install php56 # brew install php70
2. Install the PHP version switching tool
# brew install php-version # source $(brew --prefix php-version)/php-version.sh
3. View all currently installed PHP versions
# php-version
4. Switch the version
# php-version 5.6.5
5. Make the current PHP version effective
# sudo pkill php-fpm -D # sudo pkill php-fpm # sudo php-fpm -D
At this time, the current PHP version in phpinfo() It took effect
The above is the detailed content of Mac switches PHP version and makes the current PHP version take effect. For more information, please follow other related articles on the PHP Chinese website!