首页 > 解决方案 > php dyld:未为 libldap 加载库

问题描述

我在我的电脑上安装了 ruby​​,Mac OSX High Sierra但由于某种原因,我的 php 安装现在遇到了问题。我在php 7.1

按照这个(也在这里)Github建议,我试过了

brew update && brew reinstall php71

在安装时,它打破了

==> Pouring php@7.1-7.1.23.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/php@7.1/7.1.23/bin/pear config-set php_ini /usr/local/etc/php/7.1/php.ini system

有错误:

dyld: Library not loaded: /usr/local/opt/openldap/lib/libldap-2.4.2.dylib
  Referenced from: /usr/local/Cellar/php@7.1/7.1.23/bin/php
  Reason: image not found
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall php@7.1`

php终端中输入会引发相同的错误。

我尝试过的其他事情:

我怎样才能解决这个问题?

标签: phpdyld

解决方案


根据这个问题,你需要安装openldaplibiconv.

brew install openldap libiconv

我试过了,它适用于我的系统。我最初缺少 PHPintl扩展。


推荐阅读