[Date Prev][Date Next] [Chronological] [Thread] [Top]

php script for LDAP_BIND



hii
we r trying to write a php script to bind to the ldap server..
the php script is
<?php
// basic sequence with LDAP is connect, bind, search, interpret search
// result, close connection

echo "LDAP query test";
echo "Connecting ...";
$ds=ldap_connect("localhost");  // must be a valid LDAP server!
echo "connect result is " . $ds ;

if ($ds) {
    echo "Binding ...";
    $r=ldap_bind($ds);     // this is an "anonymous" bind, typically
                           // read-only access
    echo "Bind result is " . $r ;
}
?>


we also tried doin
$ldapset=ldap_set_option($ldapconn,LDAP_OPT_PROTOCOL_VERSION,3);   
and
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);

where Ldaprdn= rootdn in the slapd.conf file and ldappass is the password

we r getting the following error in all the above cases

LDAP query test
Connecting ...
connect result is Resource id #4
Binding ...PHP Warning:  ldap_bind(): Unable to bind to server: Protocol error in /var/www/html/forms/ex1.php on line 12

plz help ASAP
Thanks and Regards
Divya


Unlimited freedom, unlimited storage. Get it now