title: Creating an LDAP Server With PHP
body: <p>I'm looking to create a web based application in PHP that receives LDAP requests and sends LDAP responses back, but doesn't actually use an LDAP server. Specifically I'd like to make the contacts table in a MySQL database available to Thunderbird as an LDAP address book.</p>
  
  <p>Two Questions:</p>
  
  <ol>
  <li><p>Is there an existing library for implementing an LDAP server with PHP? (The PHP_LDAP package is for creating an LDAP client, where the PHP application connects to an existing LDAP server.)</p></li>
  <li><p>How does LDAP data actually get from the client into my script? Does LDAP travel over HTTP? Where the request would show up in:</p>
  
  <pre><code>$HTTP_RAW_POST_DATA
  </code></pre></li>
  </ol>
  
  <p>or similar? Can Apache handle LDAP requests and pass them into my script or is it a completely different protocol that requires a different "listener" application to handle?</p>