1,安装多版本php
$ brew install php54 $ brew install php70
如果安装报以下错误:
Error: Cannot install homebrew/php/php70 because conflicting formulae are installed.
php54: because different php versions install the same binaries.
Please `brew unlink php54` before continuing.
解决办法有二种:
1.1,brew unlink php54
1.2,删除/usr/local/bin,下面有关php的软链接
上面2种方法,目的是一样的。
2,安装切换工具php-version
$ brew install php-version $ source $(brew --prefix php-version)/php-version.sh $ php-version 5.4.45 * 7.0.17 $ php-version 5.4.45 //切换到5.4 $ php-version * 5.4.45 7.0.17 $ echo "source $(brew --prefix php-version)/php-version.sh" >> ~/.bash_profile
转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/php/1851.html