使用任何php应用程序都会导致:
dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib Referenced from: /usr/local/bin/php Reason: image not found [1] 4494 trace trap php
我的大多数php应用程序都是使用homebrew安装的,但composer除外(使用curl安装)
我尝试删除libpng并使用自制软件重新安装均无济于事。
接下来是按照错误消息中的说明切换到最新版本的libpng 1.5:
$ brew info libpng libpng: stable 1.6.10 (bottled) http://www.libpng.org/pub/png/libpng.html /usr/local/Cellar/libpng/1.5.17 (15 files, 1.0M) Poured from bottle /usr/local/Cellar/libpng/1.5.18 (15 files, 1.0M) Poured from bottle /usr/local/Cellar/libpng/1.6.10 (17 files, 1.3M) * $ brew switch libpng 1.5.18 Cleaning /usr/local/Cellar/libpng/1.5.17 Cleaning /usr/local/Cellar/libpng/1.5.18 Cleaning /usr/local/Cellar/libpng/1.6.10 16 links created for /usr/local/Cellar/libpng/1.5.18
现在错误已更改为:
dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib Referenced from: /usr/local/lib/libfreetype.6.dylib Reason: image not found [1] 6993 trace trap phpunit
我正在运行Mavericks(10.9.2)和PHP 5.5.1。
提前致谢!
我建议您运行:
$ brew update && brew upgrade
直到几分钟前,我也遇到了这个问题。因为我有一个最新的PHP版本,所以我用以下方法解决了它:
$ brew reinstall php55
希望能有所帮助。