I ran into a problem where I was getting a protocol error when I tried to bind. I was able to connect fine and ldap commands worked fine from the command line.
The problem turned out to be that openldap (v 2.1.5) was starting up in version 3 ldap mode, and php (4.2.3) expected it to be in version 2 mode.
To fix this use the ldap_set_option command to change the version that php expects.