解决dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib

今天安装了下node,发下PHP不能用了,提示

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
  Referenced from: /usr/local/opt/[email protected]/bin/php
  Reason: image not found
[1]    2308 abort      php

检查发现/usr/local/opt/icu4c/lib链的是63.1的,而之前安装PHP是依赖62.1的。那么处理方法也就有了:

  1. 如果/usr/local/Cellar/icu4c/下还有62.1目录,且目录的lib下有libicui18n.62.dylib等文件,则可以将这些文件复制到/usr/local/Cellar/icu4c/63.1/lib 下,主要是以下这几个文件:
libicudata.62.1.dylib
libicudata.62.dylib
libicui18n.62.dylib
libicuio.62.dylib
libicuuc.62.dylib
  1. 如果没有了,就upgrade下PHP吧,比如之前安装的是php7.1,则执行如下命令:
brew upgrade [email protected]

在执行该命令前,建议先清理下brew的缓存

brew cleanup

你可能感兴趣的:(后端)