brew安装php和扩展

brew install homebrew/php/php56 --with-apache

报错:
checking if the location of ZLIB install directory is defined... no
configure: error: Cannot find libz

解决:
xcode-select --install 五分钟之后ok

ok

note:
mac自带了一个版本的PHP, 自带的Apache关联了PHP,可以跑通,但是brew不能安装这个自带版本的PHP扩展
当brew install someextension 的时候,它会自动的安装一个版本的PHP,所有就把Apache关联到这个新安装的PHP版本上

原文地址:https://www.cnblogs.com/wangweiwen/p/7220168.html