|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-09 17:05 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
Description: ------------ EasyPHP 1.8 I have read about LDAP on php.net and i have copied the two dll files (libeay32.dll and ssleay32.dll)in my system directory and I have delete the sign ; at the start of line "extension=php_ldap.dll" in php.ini, to enable it. then restart apache. but i still cant get any informations out of active directory on my Windows server 2003, see the code I use... I will be every happy if there was somebody who could help me!!?? Reproduce code: --------------- <?php $ldap_server = "ldap://btfdc03.btf.kk.dk"; $auth_user = "jrbtest@btf.kk.dk"; $auth_pass = "xxxxxxxx"; // Set the base dn to search the entire directory. $base_dn = "DC=btf, DC=kk, DC=dk"; // Show only user persons $filter = "(&(objectClass=user)(objectCategory=person)(cn=*))"; // connect to server if (!($connect=@ldap_connect($ldap_server))) { die("Could not connect to ldap server"); } // bind to server if (!($bind=@ldap_bind($connect, $auth_user, $auth_pass))) { die("Unable to bind to server"); } // search active directory if (!($search=@ldap_search($connect, $base_dn, $filter))) { die("Unable to search ldap server"); } $number_returned = ldap_count_entries($connect,$search); $info = ldap_get_entries($connect, $search); echo "The number of entries returned is ". $number_returned."<p>"; for ($i=0; $i<$info["count"]; $i++) { echo "Name is: ". $info[$i]["name"][0]."<br>"; echo "Display name is: ". $info[$i]["displayname"][0]."<br>"; echo "Email is: ". $info[$i]["mail"][0]."<br>"; echo "Telephone number is: ". $info[$i]["telephonenumber"][0]."<p>"; } ?> Expected result: ---------------- see informations from the active directory! Actual result: -------------- and then i get this: Unable to search ldap server Then i think, is not a problem with the connections and binding with the person (jrbtest@btf.kk.dk)... is when I search!! please help!!??