note 99785 deleted from function.ldap-connect by thiago
| From: | thiago@php.net | Date: | Tue, 07 Sep 2010 04:52:11 +0000 |
| Subject: | note 99785 deleted from function.ldap-connect by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172351@lists.php.net to get a copy of this message | ||
Note Submitter: techboy
----
I am getting this error whenever i try to bind with ldap server.i tried both ways using
authentication and without authentication.Even i enabled ldap extension and copied dll files.but no
results and only error.
i am using wamp server on xp.
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server
in C:\wamp\www\newldap\newldap.php on line 12
LDAP bind failed...
following is my code.
<?php
// using ldap bind
$ldaprdn = 'root'; // ldap rdn or dn
$ldappass = ''; // associated password
// connect to ldap server
$ldapconn = ldap_connect("127.0.0.1")
or die("Could not connect to LDAP server.");
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...";
}
}
?>