Can someone please help me? I don't know what I'm missing.
ldapsearch works just fine:
I'm doing this in php:
ldapsearch -x -v -H 'ldap://hostname' -D 'uid=zimbra,cn=admins,cn=zimbra' -b "dc=com" "zimbraMailForwardingAddress=user@domain" mail -W | less
But I keep getting this error:
$c = ldap_connect("hostname") or die("Peter cannot connect to LDAP server.");
ldap_set_option($c, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($c, LDAP_OPT_REFERRALS, 0);
$bind = ldap_bind($c, $user, $pass);
This is in /etc/openldap/ldap.conf:
Mar 12 16:01:36 localhost httpd: PHP Warning: ldap_start_tls() [<a href='function.ldap-start-tls'>function.ldap-start-tls</a>]: Unable to start TLS: Connect error in /var/www/html/ldap.php on line 14
Mar 12 16:01:37 localhost httpd: PHP Warning: ldap_bind() [<a href='function.ldap-bind'>function.ldap-bind</a>]: Unable to bind to server: Can't contact LDAP server in /var/www/html/ldap.php on line 15
What am I missing? I've been banging my head against this brick wall for days. Thank you.