Hi
Im trying to make a simple connect from my centos server to my test domain.
I have disabled the firewall on the Windows Server & Centos.
Installed php-ldap.x86_64 : A module for PHP applications that use LDAP
print scr from my AD
The ERROR i get:
Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in /var/www/html/edit/ldap.php on line 16
LDAP bind failed...
I can telnet from Centos terminal too the DC fine. : telnet dc1.devlab.local 389
The script im using is this.
<?php
// using ldap bind
$ldaphost = 'dc1.devlab.local';
$ldaprdn = 'uid=ldap,OU=testOU,DC=devlab,DC=local';
$ldappass = '123456ABCabc';
$ldapport = '389';
// connect to ldap server
$ldapconn = ldap_connect($ldaphost, $ldapport)
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...";
}
}
?>