I'm building an intranet site and am trying to integrate authentication with Active Directory on a Windows 2003 domain controller. I can connect() and bind() just fine. Here is the relevent code:
$ldapconn = ldap_connect($ldaphost, $ldapport);
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
$dn = "DN=doc,DN=lan";
$filter = "(CN=*)";
$result = ldap_search($ldapconn, $dn, $filter); //error occurs on this line
The exact error is
Warning: ldap_search(): Search: Operations error in /www/index.php on line 55
I have yet to find a satisfactory explanation of this error message. I did find one bit of information that suggested passing a blank DN ($dn = ""; in my example) to the function, but that only resulted in the following error:
Warning: ldap_search(): Search: No such object in /www/index.php on line 55
Anyone have experience with these types of errors and can offer some insight?
I appreciate the assistance.