In file auth/ldap/lib.php line 51, replace line:
function ldap_init_connection($host, $port, $protocol_ver, $bind_dn=, $bind_pwd=) {
with:
function ldap_init_connection($host, $port, $version, $bind_dn=, $bind_pwd=) {
A few lines lower, you can see that the variable is being referenced as $version, which was failing to set the proper LDAP protocol option and making OpenLDAP fail to bind for searching:
@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version);
I'm not a programmer/developer, but caught this error trying to get Elgg connected to OpenLDAP and figured I'd let you know since it may also be the cause of other LDAP-related tickets/problems...