Homebrew升级后PHP报错: libicuio.70.dylib (no such file)
php -v 报错 Reason: tried: '/usr/local/opt/icu4c/lib/libicuio.70.dylib' (no such file)
执行 brew update 后 icu4c 自动升级到了72版本, 导致70丢失, 而本机需要使用的PHP7.4依赖 icu4c 7.0, 安装 icu4c@70 即可解决问题
# 安装icu4c@70, `jimmy` 是自定义文件夹名称
brew tap-new jimmy/taps
brew extract icu4c jimmy/taps --version 70
brew install jimmy/taps/icu4c@70
# 查看安装位置
ls -la /usr/local/opt/icu4c*
# 创建软连接
cd /usr/local/opt/icu4c/
ln -s /usr/local/opt/icu4c@70/lib/libicudata.70.dylib libicudata.70.dylib
ln -s /usr/local/opt/icu4c@70/lib/libicui18n.70.dylib libicui18n.70.dylib
ln -s /usr/local/opt/icu4c@70/lib/libicuio.70.dylib libicuio.70.dylib
ln -s /usr/local/opt/icu4c@70/lib/libicutest.70.dylib libicutest.70.dylib
ln -s /usr/local/opt/icu4c@70/lib/libicutu.70.dylib libicutu.70.dylib
ln -s /usr/local/opt/icu4c@70/lib/libicuuc.70.dylib libicuuc.70.dylib
# 查看文件
ls -la /usr/local/opt/icu4c/lib/*.70.*
# 查看php版本
php -v
评论