Monday, March 7, 2011

ldap_bind(): Unable to bind to server: Protocol error

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(...);

21 comments:

PRASA said...

Thanks....It was really help full to me.........

Anonymous said...

Thank you very much !
You save my day :)

Anonymous said...

a very big thank you Sir, this really helps me ....

Mohammad Nurhadi said...

thanks a lot sir.. :)
gode bless you..

Anonymous said...

Helped me a lot, thanks :D

SHRINIVAS MESE said...

thank You so much sir.. :)
it was helpfull for me.

Anonymous said...

THANKS SO MUCH, I WAS LOOKING FOR THIS SOLUTION!!!!!

SARZ said...

Waoo! I was struck in this warning for a long time, BIG Thanks!

SARZ said...

Waoo! I was struck in this warning for a long time, BIG Thanks!

Anonymous said...

It's very kind of you to public this.
Thanks so much.

Anonymous said...

thanks

Anonymous said...

Much obliged - saved me a good half hour of trying to figure out what was wrong.

Anonymous said...

Thanks man !

I was having this problem and just adding the line worked.

Thanks a lot !

Anonymous said...

Thanks a lot man !

That worked great !

Anonymous said...

Thanks! Very useful!!

Mario H. said...

Great, thank you very much. I was looking for hours and hours... :)

Lokesh said...

Thanks you have solved my problem

Anonymous said...

Merci Charith! <3

Claudio Castro said...

Thank you so much!
That was the code line I was missing.

Lê Trường Giang said...

Great, thank you very much!

Anonymous said...

I love you dude