title: PHP ldap_bind(): Unable to bind to server: Invalid credentials
body: <p>I'm connecting ldap server in my local system to server. It is successfully connected but the thing is while connecting from other server ex: B server to A server i got error like this invalid credential.</p>
  
  <pre><code>$username='ZZZ.YYY';
  $domain='test';
  $host='ldap://AAA.test.org';
  $password='XXXX';
  $port=389;
  $ldapconn = ldap_connect($host, $port)
  or die("Could not conenct to {$host}");
  if ($ldapconn) {
  
  $bind=ldap_bind($ldapconn, $username .'@' .$domain, $password);
  if ($bind) {
      echo("Login correct");
  } else {
      echo("Login incorrect");
  }
  
  }
  ldap_close( $ldapconn );
  </code></pre>
  
  <p>This code working fine for me . But the same code i pasted in another server just changed the host name for that server and domain name. here i got this error .can you please help me?</p>
  
  <pre><code>$username='ZZZ.YYY';
  $domain='test1';
  $host='ldap://BBB.test1.org';
  $password='XXXX';
  $port=389;
  
  $ldapconn = ldap_connect($host, $port)
  or die("Could not conenct to {$host}");
  
  if ($ldapconn) {
  
  $bind=ldap_bind($ldapconn, $username .'@' .$domain, $password);
  
  if ($bind) {
      echo("Login correct");
  } else {
      echo("Login incorrect");
  }
  
  }
  ldap_close( $ldapconn );
  </code></pre>