1
I am trying to make the connection with AD. However the error is displayed:
Warning: ldap_connect(): Could not create Session Handle: Bad Parameter to an ldap routine in C: Program Files (x86) Easyphp-Devserver-14.1VC9 data localweb my Portable ad.php files on line 8 Could not connect to LDAP server.
Would anyone know the possible causes for this connection failure?
<?php
$ldap_server = "192.168.2.1/nomeservidor";
$dominio = "DOMINIO/";
$user = $dominio."administrador";
echo $user;
$ldap_porta = "389";
$ldap_pass = "minhasenha";
$ldapcon = ldap_connect($ldap_server, $ldap_porta) or die("Could not connect to LDAP server.");
if ($ldapcon) {
$bind = ldap_bind($ldapcon, $user, 'minhaSenha');
if ($bind) {
echo "LDAP bind successful…";
}
else {
echo "LDAP bind failed…";
}
}
?>
Thank you in advance.
I don’t know PHP, but maybe here can help you.
– Marconi