ale1981 Posted June 21, 2006 Share Posted June 21, 2006 Using Apache2, PHP5 I keep get the following error. I am new to LDAP and PHP so please bare with me![code] $dn = "DN=LoftingConsultingLtd, DN=local"; $attributes = array("displayname", "l"); $filter = "(cn=*)"; $ad = ldap_connect("localhost") or die("Couldn't connect to AD!"); ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3); $bd = ldap_bind($ad,"[email protected]","password") or die("Couldn't bind to AD!"); $result = ldap_search($ad, $dn, $filter, $attributes); $entries = ldap_get_entries($ad, $result); for ($i=0; $i<$entries["count"]; $i++) { echo $entries[$i]["displayname"] [0]."(".$entries[$i]["l"][0].")<br />"; } ldap_unbind($ad);[/code][code]Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\www\loftingconsulting\public_html\test.php on line 22Warning: ldap_get_entries(): supplied argument is not a valid ldap result resource in C:\www\loftingconsulting\public_html\test.php on line 24[/code]Any ideas??? Is driving me bonkers! :confused: Link to comment https://forums.phpfreaks.com/topic/12524-php-and-ldap/ Share on other sites More sharing options...
ale1981 Posted June 21, 2006 Author Share Posted June 21, 2006 Sorry, my error. Please close. Link to comment https://forums.phpfreaks.com/topic/12524-php-and-ldap/#findComment-47954 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.