Note that you have to specify the protocol version prior to making a call to ldap_bind, when the server is expecting LDAP protocol version 3. If you do not, you will receive a warning and fail to bind, such as:
ldap_bind(): Unable to bind to server: Protocol error
In order to avoid this, make this call:
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
?>
Where $ds is the result returned by ldap_connect(...);