Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an LDAP server runs on:
ldap:// where =

I have this configuration in config.php in phpldapadmin:

$servers = new Datastore();
$servers->setValue('server','name','My LDAP Server');

in my sldap.conf:

database    bdb
directory   /usr/local/var/openldap-data
suffix      "dc=roshd,dc=org"
rootdn      "cn=Manager,dc=roshd,dc=org"
rootpw      secret

but when I attemp to login in phpldapadmin, I got this error. is there any idea?

Unable to connect to LDAP server My LDAP Server
Error: Can't contact LDAP server (-1) for user
error   Failed to Authenticate to server
Invalid Username or Password.

share|improve this question
+1 for a well written question! – geoffc Jan 23 '11 at 19:20
Did you ever resolve this? – Cerin Mar 22 '11 at 20:44
@Chris : no I just install iRedmail CentOS and use it's preconfigured OpenLDAP – Mohammad Ali Akbari Mar 25 '11 at 14:40
up vote 3 down vote accepted

Spot the difference:



share|improve this answer

I suspect that the rootpw is either expected to be stored encrypted, and you have it clear text, in which case it is expecting perhaps a different result. (I.e. The hashed value of secret is being sent and being compared to the clear text string secret.)

share|improve this answer
I think no, there is another option for SASL Authentication in config.php, but I will try it – Mohammad Ali Akbari Jan 23 '11 at 19:53

If you are authenticating against ldap itself, you might want to check this setting: $servers->setValue('login','attr','uid');

/* If you specified 'cookie' or 'session' as the auth_type above, you can
   optionally specify here an attribute to use when logging in. If you enter
   'uid' and login as 'dsmith', phpLDAPadmin will search for (uid=dsmith)
   and log in as that user.
   Leave blank or specify 'dn' to use full DN for logging in. Note also that if
   your LDAP server requires you to login to perform searches, you can enter the
   DN to use when searching in 'bind_id' and 'bind_pass' above. */
// $servers->setValue('login','attr','dn');
share|improve this answer

I had the same issue. You can check below.

  1. Check If you have right ipaddress in $servers->setValue('server','host','ipaddress'); in ldap.conf file. and restart tomcat server. Cheers.

  2. Check if user you are trying to login with exist or not using "ldapsearch -x" on terminal.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.