今天折腾一个叫vips的图像处理扩展,安装官方流程执行 brew install vips
没任何报错, 然后 pecl install vips
就发生报错
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
[1] 11703 abort php -m
然后执行php各种命令都报这个错误 , 上网查了下说是icu4c 这个依赖的问题,
brew info icu4c
查看这个库的详情
icu4c: stable 63.1 (bottled) [keg-only]
C/C++ and Java libraries for Unicode and globalization
https://ssl.icu-project.org/
/usr/local/Cellar/icu4c/60.2 (249 files, 67MB)
Poured from bottle on 2018-01-09 at 15:04:28
/usr/local/Cellar/icu4c/61.1 (249 files, 67.2MB)
Poured from bottle on 2018-09-18 at 18:41:26
/usr/local/Cellar/icu4c/62.1 (250 files, 67.3MB)
Poured from bottle on 2018-11-06 at 19:11:45
/usr/local/Cellar/icu4c/63.1 (254 files, 68.4MB)
Poured from bottle on 2018-12-08 at 14:18:09
很明显问题原因出来了:版本问题,我现在的版本是63.1
,php需要的版本是 62
,估计是我安装其他依赖的时候自动给我升级的吧,切换过来就行了
brew switch icu4c 62.1