I have been trying to connect to a secure LDAP server with no luck. The documentation on this is a bit sparse so I was hoping someone out there is an LDAP guru and could lend a hand. From what I can glean from the doco and a few online tutorials, this is what I have done.
- uncommented extension=php_ldap.dll and extension=php_openssl.dll in my php.ini file.
- Installed openssl.
- Put a ldap.conf file in C:\openldap\sysconf.
Here is my PHP code:
$ldapserver=ldap_connect("ldapserver.mydom.com");
if(!$ldapserver)
{
print "System Error";
exit(0);
}
$bind = ldap_bind($ldapserver);
if(!bind)
{
print "System Error";
exit(0);
}
I can connect but when I go to bind, I do not receive any response. No error and no data. I think this is because the certificate is not being recognized.
My setup:
Apache 2.0
PHP 5.2.3
WinXP Home
Connecting to a SunOne LDAP server. Thanks.