Toggle PHP Version:
Brew Install php-[version]
[Version]=56|70 etc
Brew Unlink php-Previous version
Brew Link php-now version
The appropriate configuration is to manage PHP extensions in/usr/local/etc/php/:
First: Brew Tap homebrew/php
View related extensions: Brew search
Installation expansion: Brew install php-[version]-extension name
such as: Brew Install Php56-redis
Uninstall expansion: Brew Uninstall php-[version]-expand name
Delete the appropriate profile: Rm-rf/usr/local/etc/php/5.6/conf.d/ext-imagick.ini
Note: If you need to install pthreads and so on, because this kind of expansion relies on PHP zts version (Zend thread Safety), and Brew By default install NTS version (Thread Safety), will cause expansion and PHP version conflict. At this point, you can only iterate from the source code, that is, add--build-from-source to the installation command such as Brew install--build-from-source Php56-redis