偶然机会,手贱点击了系统升级到:macOS Sierra 10.12.5 (16F73)
然后发现系统的php升级到了7.0,但是Configure项里边却使用的是PHP5的路径
--prefix=/usr/local/php5,并且莫名其妙无法使用加密相关的mcrypt等库,重启FPM会抛一堆的错误,提示扩展库无法加载。
狠心的将系统的所有php5关联信息清理掉:
brew unlink php55
brew unlink php56
sudo rm -rf /user/local/php5
sudo rm -rf /user/local/php5.5
sudo rm -rf /user/local/php5.6
.....清理其他冗余的版本。
然后重新查询系统的php70状态
brew search php70 查看php7.0关联的所有插件是否已经安装(如下效果)
1、若没有关联库的,需要先配置第三方库:brew tap homebrew/homebrew-php;
2、已经有列表的:brew install或upgrade php70;
在重装或者升级时,可以指定配置选项,例如我本地环境:
brew upgrade php70 --with-curl --with-iconv --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --enable-fpm --enable-mysqlnd --with-mcrypt --enable-zip --with-pear --enable-soap --enable-mbstring --enable-sockets --with-gd --with-zlib --with-libxml-dir --enable-xml --enable-gd-native-ttf --with-xmlrpc --with-mhash --with-jpeg-dir=/usr/local/php70 --with-png-dir=/usr/local/php70 --with-openssl --enable-exif --with-xsl --enable-calendar --enable-pcntl --enable-dtrace --enable-opcache --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-bcmath --prefix=/usr/local/php70
3、然后发现常规使用的例如memcache\redis\opcache\mcrypt\intl 有缺失的:
brew install php70-redis|intl
搞定!!