Hi,
I am working on php under Apache on windows.
I would like to connect to Active directory using LDAP server with SSL.
I wrote the program,
<?php
/* Declaration of the global variables*/
$server_name="ldaps://mydomain.com";
$port="636";
$base_dn = "DC=mydomain, DC=com";
$ldapdn = "adminusername@mydomain.com";
$ldappass = "adminpass";
/* Connect, and bind directory */
$link_id = ldap_connect($server_name, $port);
if($link_id) {
echo "Connection successful to $server_name<br>";
if (ldap_set_option($link_id, LDAP_OPT_PROTOCOL_VERSION, 3)) {
echo "Using LDAPv3 <br>";
} else {
echo "Failed to set protocol version to 3<br>";
}
if(ldap_bind($link_id, $ldapdn, $ldappass)) {
echo "Bind successful";
} else {
echo "Bind failed";
}
} else {
echo " Connection failed";
}
?>
I get results,
Connection successful to ldaps://mydomain.com
Using LDAPv3
Bind failed
What are the other things that i need to perform for connection and binding like php config,
how to configure php to load the LDAP and SSL modules. How to enable SSL over LDAP on Windows Domain Controller.
Please help.
Thanks.