執行php -v報如下錯誤
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib Referenced from: /usr/local/bin/php Reason: image not found [1] 89488 abort php -v
出現問題的原因應該是安裝thrift以后icu4c升級導致的, 本地php7.1依賴icu4c庫版本為63
ll /usr/local/Cellar/icu4c total 0 drwxr-xr-x 12 fww staff 384B 4 22 21:23 64.2
為了php正常運行需要回滾到63版本, thrift再說吧,以下為回滾過程
#切換目錄 cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula #git查看提交版本 git log --follow icu4c.rb #回滾到63版本,沒有看到63的提交記錄,選擇了最初的一個提交版本回滾 git checkout -b icu4c-63.1 xxxx(版本號) #brew重新安裝icu4c brew reinstall ./icu4c.rb
驗證結果
# php -v
PHP 7.1.26 (cli) (built: Feb 26 2019 10:26:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans
with Zend OPcache v7.1.26, Copyright (c) 1999-2018, by Zend Technologies
參考原文
https://blog.csdn.net/youshaoduo/article/details/89228454
