簡體   English   中英

Laravel 5.5 中 AdLdap2 的問題

[英]Issue with AdLdap2 at Laravel 5.5

當我嘗試在 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

問題解決了。

我安裝了 LDAP 庫並從頭開始使用 LDAP 重新編譯 PHP。

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

對於宅基地盒(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 的盒子以查看更新。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM