PHP连接错误ldap_bind(): Unable to bind to server: Protocol error in

PHP连接错误ldap_bind(): Unable to bind to server: Protocol error in


// using ldap bind
$ldaprdn  = 'cn=admin,dc=test,dc=com';     // ldap rdn or dn
$ldappass = 'test1';  // associated password


// connect to ldap server
$ldapconn = ldap_connect("ldap://192.168.1.36",'389')
    or die("Could not connect to LDAP server.");






//擦。。加上这个函数就不会报错了。好像是要设置下级别。 ldap_bind(): Unable to bind to server: Protocol error in
if (ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3)) {
    echo "Using LDAPv3"."
;"; } else { echo "Failed to set protocol version to 3"."
;"; } if ($ldapconn) { // binding to ldap server $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); // verify binding if ($ldapbind) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; } } exit;

你可能感兴趣的:(myphp)