Hi,
I am trying to code an application which should authenticate the users against LDAP server. I tried to follow the example provided in the PHP documentation but getting the following error.
Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in /home/avattala/web/aldap/a.php on line 5
Can't contact LDAP server
The following is my code:
<?php
$ldap = ldap_connect("server.domain.com", 389) or die("Cannot connect to the ldap server");
if (!($res = ldap_bind($ldap)))
{
print(ldap_error($ldap) . "<br>");
die("Could not bind to $dn");
}
Can anyone help me to figure out how to fix this?
Thank you!
Anil