title: LDAP Auth on WAMP
body: <p>I'm trying to write some LDAP authentication code on my WAMP server.</p>
  
  <p>I'm using this:</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  ini_set("display_errors", 1);
  
  $ldapconfig['host'] = 'my.server.province.country';
  $ldapconfig['port'] = 389;
  $ldapconfig['basedn'] = 'DC=x,DC=y,DC=z,DC=x1';
  $ldapconfig['authrealm'] = 'My Realm';
  
  ldap_connect($ldapconfig['host'], $ldapconfig['port']) or die ('Could not connect');
  
  echo 'connected';
  ?&gt;
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined
    function ldap_connect() in C:\Program
    Files\Apache Software
    Foundation\Apache2.2\htdocs\oplweb\index.php
    on line 10</p>
  </blockquote>
  
  <p>From some basic Googling, it looks like I need to turn on mod_ldap. Seems simple. I've done the following:</p>
  
  <ul>
  <li>Went to C:\Program Files\Apache
  Software Foundation\Apache2.2\modules
  and made sure that mod_ldap.so
  exists.</li>
  <li>I've gone into C:\Program
  Files\Apache Software
  Foundation\Apache2.2\conf\httpd.conf
  and made sure that this line is not
  commented out: LoadModule ldap_module
  modules/mod_ldap.so</li>
  <li>I've gone into
  C:\Program Files\PHP\php.ini and made
  sure this line is not commented out:
  extension=php_ldap.dll</li>
  <li>Restart apache</li>
  </ul>
  
  <p>The problem still persists. Does the ldap_connect() function in php have any other dependencies? Am I missing a step?</p>
  
  <p>Cheers</p>