iis 7 - PHP cannot anonymously bind to LDAP -


The problem is that I can add LDAP via PHP, but I can not force it.

In the Apache Directory Studio I can connect and tie without any problems, but the PHP result is always "FAIL"

How is PHP linked to LDAP?

  & lt ;? Php $ ldaphost = "ldaps: //server.net"; $ Ldapport = 636; $ Ldapconn = ldap_connect ($ ldaphost, $ ldapport); If ($ ldapconn) {echo 'connected'; $ Ldapbind = ldap_bind ($ ldapconn); If ($ ldapbind) {echo "OK"; } And {echo "unsuccessful"; }}  

Try setting the protocol version

 < Code> & lt ;? Php // unmatched connection $ ldaphost = "ldaps: //server.net"; $ Ldapport = 636; $ Ldapconn = ldap_connect ($ ldaphost, $ ldapport) or die ("Can not connect to LDAP server."); If ($ ldapconn) {echo 'connected'; // Set protocol version ldap_set_option ($ ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); // anonymous identity $ ldapbind = ldap_bind ($ ldapconn); If ($ ldapbind) {echo 'OK'; } And {echo 'failed'; }}? & Gt;  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -