我在使用Windows連接到安全的LDAP服務器時遇到了問題,而且我在任何地方都可以看到相同的事情,但目前還沒有解決方案。LDAPS未與PHP連接
我試過使用IIS和WAMPSERVER。我已將libeay32.dll和ssleay32.dll放在我的SYSTEM32目錄中並啓用了LDAP擴展。
這裏是我的代碼:
putenv('LDAPTLS_REQCERT=never');
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
$resource = ldap_connect("ldaps://{redacted}/", 636) or die ("Could not connect.");
ldap_set_option($resource, LDAP_OPT_PROTOCOL_VERSION, 3)
$bound = ldap_bind($resource, "{redacted}\ldap", "****");
echo ldap_error($resource);
我從ldap_error和PHP警告Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server in C:\wamp\www\ldapTest.php
我試圖連接到運行Active Directory服務器獲取Can't contact LDAP server
,我已經證實,我可以連接通過使用其他LDAP工具。我知道這臺服務器有一個問題,它的證書 - 我使用的LDAP工具說The server you are trying to connect to is using a certificate which could not be verified! - Issuer certificate not found
我懷疑是壞證書導致綁定問題,這就是爲什麼我試過LDAPTLS_REQCERT =從不。
感謝隊友的答案,但不幸的是這並沒有爲我工作。 – Sam 2012-01-17 06:30:55