参考教程 安装brew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 安装PHP5.6 brew install php56 \ --without-snmp \ --without-apache \ --with-fpm \ --with-intl \ --with-homebrew-curl \ --with-homebrew-libxslt \ --with-homebrew-openssl \ --with-imap \ --with-mysql \ --with-tidy` 不要用–without-debug方式安装 否则会造成php扩展模块编译后与php不兼容 修改系统环境 在~/.bash_profile中添加环境 export PATH="/usr/local/bin:/usr/local/sbin:$PATH" 安装php56扩展