如果安装了xcode,那么推荐使用brew来安装php。 打开终端输入: brew tap homebrew/homebrew-php 然后在输入: brew install php55 --with-cgi