Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib

 

前天mac用brew安装NodeJs时候 ,把icu4c这个目录中的lib/libicui18n.61.dylib搞丢了,nodeJs需要的可能是libicui18n.64.dylib这个版本,但是安装是时候把PHP依赖的libicui18n.61.dylib丢了,是删除了还是升级了,不知道,反正是没有了。在我运行PHP的包工具composer时候,运行命令:composer install,出现下面错误: 

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/opt/php@5.6/bin/php
  Reason: image not found
Abort trap: 6

 解决方法:

1,下载libicui18n.61.dylib 这个包,地址:https://ssl.icu-project.org/files/icu4c/

      注意一定要是icu4c-61_1-src.tgz 这个,不要下zip的,zip是针对win系统的,会报错。如下:

localhost:Downloads fangliang$ ./icu/source/configure
-bash: ./icu/source/configure: /bin/sh^M: bad interpreter: No such file or directory

上面这个问题也可以解决:

先在控制台cd到报错的目录

vi configure
:set ff ?
如果出现fileforma=dos那么就基本可以确定是这个问题了。
:set fileformat=unix
:wq

 2, 下载到机器什么地方都可以,解压tar -xzvf icu4c-61_1-src.tgz

     1,配置,编译,安装。如下:

cd ./source
./configure
make
make install

在configure时候可能出现下面的错误:

configure: error: in `/Users/fangliang/Downloads/icu':
configure: error: C compiler cannot create executables
See `config.log' for more details

3,查看config.log,可能会看到这样的错误:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
configure:2971: $? = 1
configure:2960: clang -v >&5
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
configure:2971: $? = 1
configure:2960: clang -V >&5
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
configure:2971: $? = 1
configure:2960: clang -qversion >&5
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
configure:2971: $? = 1
configure:2991: checking whether the C compiler works
configure:3013: clang    conftest.c  >&5
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

4,证明xcrun没有安装。在终端执行xcrun,安装:

xcode-select --install

5,安装成功之后。

make 成功

make install 成功

6,验证PHP 

    PHP --version  可用

  composer install  可用

 

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yijiliangfang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值