- 论坛徽章:
- 0
|
为什么啊??????
i have resolve this problem
look my program
<?
$ds=ldap_connect("localhost","389"
or die("Could not connect ldap" ;
if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
echo "Using LDAPv3<br>;";
} else {
echo "Failed to set protocol version to 3<br>;";
}
$r=ldap_bind($ds);
echo "Bind result is ".$r."<br />;";
?>;
in php manuel i found if the version of openldap >;2 the php will have some problem on ldap_bind(); because php try to use ldapv2 to bind, but the >;2 version openldap use ldapv3.
so you must key in:
if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
echo "Using LDAPv3<br>;";
} else {
echo "Failed to set protocol version to 3<br>;";
} |
|