title: PHP - querying the VMware View ADAM database
body: <p>I'm writing PHP code and trying to connect to VMware View ADAM database but unfortunately without success. This is LDAP type of database, similar to Active Directory but can not make it to work! A user which is connecting to ADAM is a Active Directory domain user.</p>
  
  <p>So here is the code:</p>
  
  <pre><code>private $ldap_server = "ldap://adam.domain.com";
  private $auth_user = "UID=adam.read,OU=someOU,OU=ServiceAccs,DC=domain,DC=com";   
  private $auth_pass = "password";
  
  $ADAMconnection=ldap_connect($this-&gt;ldap_server);
  
  ldap_set_option ($ADAMconnection, LDAP_OPT_REFERRALS, 0);
  ldap_set_option($ADAMconnection, LDAP_OPT_PROTOCOL_VERSION, 3);
  
  if ($ADAMconnection) {       
     $r=ldap_bind($ADAMconnection, $this-&gt;auth_user, $this-&gt;auth_pass);      // line 29
  
     if($r)
     {
        echo "&lt;p&gt;Bind successful&lt;/p&gt;";
     }
     else
     {
        echo "&lt;p&gt;Bind not successful&lt;/p&gt;";
     }
     echo "&lt;p&gt; $r&lt;/p&gt;";
  }
  </code></pre>
  
  <p>And this is the warning I get at line 29 (bind statement):</p>
  
  <pre><code>Warning: ldap_bind(): Unable to bind to server: Other (e.g., implementation specific) error
  </code></pre>
  
  <p>User has 'read' permissions - I checked with ADSIEdit. I also tried replacing the username with the following code but still without success: </p>
  
  <pre><code>private $auth_user = "adam.read@domain.com";  
  </code></pre>
  
  <p>EDIT: Forgot to mention programming environment.</p>