Reputation: 9292
I'm trying to develop an application which uses the same login we use in our company to log in our computer, that is, an Active Directory. So, I'm sure which is my user and my password but it seems every time I try to bind it throws this:
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server
But the ldap_connect success.
So, it must be something related with the username.
I've tried with:
$user='cn=username,o=domainname';
and
$user='domainname\username';
Without success. I've admin access to the domain controller so I could find whatever is needed.
Can someone bring some light to this?
Upvotes: 0
Views: 8218
Reputation: 31107
You do not connect when calling ldap_connect
. See the PHP manual:
When OpenLDAP 2.x.x is used, ldap_connect() will always return a resource as it does not actually connect but just initializes the connecting parameters. The actual connect happens with the next calls to ldap_* funcs, usually with ldap_bind().
I guess you have some network problems here. One of the following:
Upvotes: 0