Server : Apache System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 User : apache ( 48) PHP Version : 8.0.28 Disable Function : NONE Directory : /var/www/html/venkat/electiveaug22/ |
<?php
$ldaprdn = "venkat"; // ldap rdn or dn
$ldappass = "v";
// connect to ldap server
$ldapconn = ldap_connect("172.31.1.42")
or die("Could not connect to LDAP server.");
if ($ldapconn) {
echo "binding";
// binding to ldap server
//ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION,3);
$ldapbind = ldap_bind($ldapconn);
// verify binding
if ($ldapbind) {
echo "LDAP bind successful...";
} else {
echo "LDAP bind failed...";
}
}
?>