brew install php56

Dupes

brew tap homebrew/dupes

加入版本

brew tap homebrew/versions

加入PHP

brew tap homebrew/homebrew-php

列出php5.6的选项

brew options php56

好了,开始安装吧,go

brew install php56

在安装的时候,没有顺利的安装成功,碰到倒了如下错误。

 wrong number of arguments (3 for 0..2)

这个错误猜测可能是因为之前已经有安装过的PHP版本,后来把这个给删掉就好了。删除方法点击这里

安装完成之后,记得设置php的lib目录,否则在cli的模式下不能使用最新的。