$/Users/didi/.composer/vendor/bin/phpcbf
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /usr/local/opt/php@7.0/bin/php
Reason: image not found
Trace/BPT trap: 5
$ which php
/usr/local/opt/php@7.0/bin/php
$otool -L /usr/local/opt/php@7.0/bin/php
/usr/local/opt/php@7.0/bin/php:
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libexslt.0.dylib (compatibility version 9.0.0, current version 9.15.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/readline/lib/libreadline.7.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 51.0.0, current version 51.0.0)
/usr/local/opt/jpeg/lib/libjpeg.9.dylib (compatibility version 12.0.0, current version 12.0.0)
/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
/usr/local/opt/libxml2/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.7.0)
/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
/usr/local/opt/freetype/lib/libfreetype.6.dylib (compatibility version 22.0.0, current version 22.0.0)
/usr/local/opt/unixodbc/lib/libodbc.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.26.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
发现最近一些lib的升级导致php依赖库版本不匹配
可以参考这个进行替换,但是替换后其他应用受到影响
which python
输出:
/usr/local/bin/python
otool -L /usr/local/bin/python
输出:
/usr/local/bin/python:
/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/Python (compatibility version 3.6.0, current version 3.6.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
可以看出依赖3.6.3已经写死了
# 将 /usr/local/bin/python 的依赖更改为当前版本python的路径
# 更改为当前python3.6.5的路径
install_name_tool -change /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/Python /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/Python /usr/local/bin/python
所以升级安装php问题解决
https://github.com/Homebrew/homebrew-php/issues/4575