Login with Activedirectory

Asked

Viewed 133 times

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.

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.