hi, i am trying to bind to an ldap server, but as of yet have been unable to. This is the error I get:
Warning: ldap_start_tls() [function.ldap-start-tls]: Unable to start TLS: Connect error in C:\apache\htdocs\tool\connect_ldap.php on line 46 LDAP TLS error.
And this is my code (assuming $password, $username, $ou, and $dc have all been assigned correctly)
$conn = ldap_connect(ldap.learning.com, 389) or die ("Connection failed.");
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3) or die ("Can't use version 3!");
ldap_start_tls($conn) or die("LDAP TLS error.");
if ($password)
$auth = @ldap_bind($conn, "uid=$username,ou=$ou,dc=$dc,dc=com", password);
ldap_close($conn);
i have looked at the code above over and over again, and compared it to other code snippets that connect to the same server, and those code snippets work. which has led me to believe that maybe it is my testbed that is incorrectly setup... any help whatsoever would be greatly appreciated