0
I am trying to connect my php application for authentication with Active Directory from Windows Server 2003, using ssl hold authentication. but it n connects returns this error
PHP Warning: ldap_bind(): Unable to bind to server: Can’t contact LDAP server in /var/www/html/Ldap/teste1.php
//Here’s the code I use
AD_server = "ldaps://meuservidor";
$AD_Auth_User = "password";
$protocolVersion = 3;
$ldap = ldap_connect($AD_server);
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $protocolVersion) ;
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
ldap_bind($ldap);
if (ldap_errno($ldap)) {
exit('Nao foi possivel conectar no servidor');
}else{
return true;
}
?>
The error seems clear that your script is unable to connect to the server. You are adding the Domain controller and the domain to his name? For example:
ldaps://meuservidor.DOMAINCONTROLLER.suaempresa.com.br
depending on how the AD server is configured there.– humungs
looks with ldap:meuservidor it connects, but when I use ldaps://meuservidor it n connects
– Sam
Is your AD server enabled over SSL? Is the certificate valid? Take a look at this one link.
– humungs
I’ve done all this but I don’t know what’s going on, he doesn’t want to connect, I’ve been in this problem for 7 days, I need help!!
– Sam