Mac下brew重新安装php 阿星小栈

手欠升级了一下Mac系统,发现php php-fpm都启动不了并报错 

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Trace/BPT trap: 5

 寻找各种办法都解决不了,不得已重装php

 解决参考:http://www.phpersay.com/index.php?c=index&m=articleDetailInfo&id=112

 (按上操作后,7.0版本可正常启动,但7.1和7.2依然报错,每个版本逐个解决太麻烦  so 不得已卸载重装PHP)

查看brew安装过的服务列表
  brew services list

#查看是否有php@7.0,如果有

  brew uninstall php@7.0

Uninstalling /usr/local/Cellar/php@7.0/7.1.12_23... (506 files, 47.9MB)

#删除对应的配置文件

 rm -rf /usr/local/etc/php/7.0

 

  brew doctor

 

重新安装:

brew install php@7.0  

接下来课继续安装 php@7.1和php@7.2,我是多版本切换所以都装

 

 

安装参考:http://www.phpersay.com/index.php?c=index&m=articleDetailInfo&id=112

解决参考:http://www.phpersay.com/index.php?c=index&m=articleDetailInfo&id=112

原文地址:https://www.cnblogs.com/dereckbu/p/9356449.html