【问题标题】:Issue with AdLdap2 at Laravel 5.5Laravel 5.5 中的 AdLdap2 问题
【发布时间】:2017-10-27 13:48:30
【问题描述】:

当我尝试在 Laravel 5.5 中使用 LDAP 时收到一个错误

"Use of undefined constant LDAP_OPT_PROTOCOL_VERSION - assumed 'LDAP_OPT_PROTOCOL_VERSION'"

但是,我已经启用了 LDAP 的 PHP 扩展

$ php --ini |grep ldap

/etc/php.d/ldap.ini,

$ cat /etc/php.d/ldap.ini
; Enable ldap extension module
extension=ldap.so

和php信息

$ php --info |grep ldap
/etc/php.d/ldap.ini,
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
ldap
ldap.max_links => Unlimited => Unlimited

我正在使用

$ php -v
PHP 7.1.10 (cli) (built: Sep 30 2017 10:30:04) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.10, Copyright (c) 1999-2017, by Zend Technologies

【问题讨论】:

  • 您解决了这个问题吗?我也有同样的问题。
  • 是的,问题已解决。我使用了新的实例,更改了 Web 服务器,安装了库并从头开始编译 PHP,-with--ldap --enable-ldap

标签: php laravel ldap adldap


【解决方案1】:

问题解决了。

我安装了 LDAP 库并从头开始使用 LDAP 重新编译 PHP。

./configure --other-extensions --with-ldap --enable-ldap

【讨论】:

    【解决方案2】:

    用于宅基地盒(laravel vagrant 机器)或其他带有 php-fpm 和 nginx 的 Ubuntu 上的 ldap...

    apt-get install php5.6-ldap
    apt-get install php7.0-ldap
    apt-get install php7.1-ldap
    apt-get install php7.2-ldap
    

    这将安装并设置您需要的一切。

    确保您shutdown -h now 并重新启动您的 php-fpm 和 nginx 以查看更新。

    【讨论】:

      猜你喜欢
      • 2019-05-28
      • 2018-03-22
      • 2018-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-06
      • 2019-02-15
      相关资源
      最近更新 更多