I am running PHP on a Windows Server 2003 machine and I want to be able to use LDAP to authenticate to Active Directory with my PHP applicaitons. I enabled the ldap extension in php.ini. Is there anything else i need to do to get LDAP to work? When I try to bind to active directory, I get the following error:
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in C:\Program Files\Apache Group\Apache2\htdocs\Test\ldaptest.php on line 4
Couldn't bind to AD!
My code is simply:
<?php
$ad = ldap_connect("ldap://corprddc1.hfc.ad")
or die("Couldn't connect to AD!");
$bd = ldap_bind($ad,"ldapuser@hfc.ad","password")
or die("Couldn't bind to AD!");
?>
Please help!