mac报错Symbol not found以及icu4c报错

环境:mac php7.3

➜ ~ php -v

dyld[40843]: Symbol not found: __ZN6icu_7310DateFormat22createDateTimeInstanceENS0_6EStyleES1_RKNS_6LocaleE

Referenced from: /usr/local/Cellar/php@7.3/7.3.33_7/bin/php

Expected in: /usr/local/Cellar/icu4c/73.2/lib/libicui18n.73.2.dylib

[1] 40843 abort php -v

终于解决了

参考本地报错:Mac PHP7.1 dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib | Laravel China 社区

卸载icu4c

我是先 rm -rf /usr/local/Cellar/icu4c

➜ ~ rm -rf /usr/local/Cellar/icu4c

➜ ~ php -v

dyld[15233]: Library not loaded: @loader_path/../../../../opt/icu4c/lib/libicui18n.73.dylib

Referenced from: /usr/local/Cellar/php@7.3/7.3.33_7/bin/php

Reason: tried: '/usr/local/Cellar/php@7.3/7.3.33_7/bin/../../../../opt/icu4c/lib/libicui18n.73.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@loader_path/../../../../opt/icu4c/lib/libicui18n.73.dylib' (no such file), '/usr/local/Cellar/php@7.3/7.3.33_7/bin/../../../../opt/icu4c/lib/libicui18n.73.dylib' (no such file), '/usr/local/lib/libicui18n.73.dylib' (no such file), '/usr/lib/libicui18n.73.dylib' (no such file, not in dyld cache)

[1] 15233 abort php -v

再 brew uninstall icu4c,报错 icu4c

➜ ~ brew uninstall icu4c

==> Downloading https://formulae.brew.sh/api/formula.jws.json 100.0%

==> Downloading https://formulae.brew.sh/api/cask.jws.json

curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

Warning: cask.jws.json: update failed, falling back to cached version.

==> Downloading https://formulae.brew.sh/api/cask.jws.json 100.0%

Error: No such keg: /usr/local/Cellar/icu4c

再安装 icu4c,报错

~ brew install icu4c

Error: icu4c: Failed to download resource "icu4c"

Download failed: https://ghcr.io/v2/homebrew/core/icu4c/blobs/sha256:4400e31a217d6ffcd2bd06e26ecbeed768133493bfcc4cb3c9ff9702f480beb6

继续报错

curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

Warning: formula.jws.json: update failed, falling back to cached version.

Error: Cannot download non-corrupt https://formulae.brew.sh/api/formula.jws.json!

然后百度

Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

参考文档

brew install nginx报错Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds | 天問-专注于大前端技术

设置一下

➜ ~ export HOMEBREW_NO_INSTALL_FROM_API=1

➜ ~ brew install icu4c

You have 26 outdated formulae installed.

==> Fetching icu4c

==> Downloading https://ghcr.io/v2/homebrew/core/icu4c/manifests/73.2

Already downloaded: /Users/laiqingtao/Library/Caches/Homebrew/downloads/2e5082de52a2c85ae665e51f8d0de0651611397cb02f4b4e2bb37898ba52a629--icu4c-73.2.bottle_manifest.json

==> Downloading https://ghcr.io/v2/homebrew/core/icu4c/blobs/sha256:4400e31a217d6ffcd2bd06e26ecbeed768133493bfcc4cb3c9ff9702f480beb6

##################################################################################################################################################################################################### 100.0%

==> Pouring icu4c--73.2.ventura.bottle.tar.gz

==> Caveats

icu4c is keg-only, which means it was not symlinked into /usr/local,

because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH, run:

echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc

echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc

For compilers to find icu4c you may need to set:

export LDFLAGS="-L/usr/local/opt/icu4c/lib"

export CPPFLAGS="-I/usr/local/opt/icu4c/include"

==> Summary

🍺 /usr/local/Cellar/icu4c/73.2: 268 files, 79.5MB

==> Running brew cleanup icu4c...

Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.

Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).

安装成功

➜ ~ PHP -v

PHP 7.3.33 (cli) (built: Aug 4 2023 15:02:14) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies

with Xdebug v3.1.6, Copyright (c) 2002-2022, by Derick Rethans

with Zend OPcache v7.3.33, Copyright (c) 1999-2018, by Zend Technologies

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值