第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

CentOS 7 上的 PHP:LDAP 無法綁定到服務(wù)器

CentOS 7 上的 PHP:LDAP 無法綁定到服務(wù)器

PHP
慕尼黑8549860 2022-10-09 20:09:36
我有以下代碼    public function openConnection()    {        $this->ldapServerHandle = ldap_connect(ConfigH::getConfig()->ldap->host);        $bindDN = ConfigH::getConfig()->ldap->serviceAccount->bindDN;        if ($this->ldapServerHandle) {            $this->ldapBindHandle = ldap_bind(                $this->ldapServerHandle,                $bindDN,                ConfigH::getConfig()->ldap->serviceAccount->password            );            if (!$this->ldapBindHandle) {                $errorMsg = "LDAP::__construct(): Could not bind the service account ".$bindDN;                LoggerH::emergency($errorMsg);                throw new LDAPException($errorMsg);            }        } else {            $errorMsg = "LDAP::__construct(): Could not connect to the LDAP server ".ConfigH::getConfig()->ldap->host;            LoggerH::emergency($errorMsg);            throw new LDAPException($errorMsg);        }    }問題從今天早上開始,我遇到了這個(gè)錯(cuò)誤,讓我很頭疼:Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server [...]在 Windows 上一切正常,當(dāng)我在 CentOS 生產(chǎn)服務(wù)器上執(zhí)行代碼時(shí),它停止工作。我已經(jīng)檢查過的OpenLDAP 已安裝并啟用LDAP 服務(wù)器可從 CentOS 服務(wù)器訪問(Kerberos 在同一臺(tái)機(jī)器上沒有遇到任何問題)我已經(jīng)嘗試過的重新安裝了php-ldap擴(kuò)展檢查憑據(jù)和地址一百萬次附加信息ConfigH::getConfig()->ldap->host 返回類似“adserver.ourcompany.com”的內(nèi)容,這是我們的 LDAP 服務(wù)器的地址ConfigH::getConfig()->ldap->serviceAccount->bindDN 返回一個(gè)有效的綁定 DNConfigH::getConfig()->ldap->serviceAccount->password 返回服務(wù)賬號(hào)的密碼
查看完整描述

1 回答

?
夢(mèng)里花落0921

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超6個(gè)贊

解決方案

使用 CentOS 的人獲得 SELinux,是的。
在深入挖掘 Google(例如結(jié)果的第 4 頁(yè))和 Stackoverflow 之后,我發(fā)現(xiàn)問題是由 SELinux 限制httpd通過某些端口進(jìn)行通信,盡管防火墻被配置為允許它,包括 LDAP 端口。

要允許httpd通過這些端口進(jìn)行通信,請(qǐng)運(yùn)行以下命令

setsebool -P httpd_can_network_connect 1

(這里的原始解決方案(WhoIsRich 的回答))


查看完整回答
反對(duì) 回復(fù) 2022-10-09
  • 1 回答
  • 0 關(guān)注
  • 146 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)