mac下brew安装php

brew install php56

直接安装一直提示失败

$ brew install php
Updating Homebrew...
Error: No available formula with the name "php" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

解决

brew tap homebrew/homebrew-php

切换版本

vim ~/.bash_profile

添加内容

export PATH=/usr/local/php5-7.0.7-20160526-160257/bin:$PATH

重新加载

source ~/.bash_profile