php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36670 Cant get any informations out of the Active Directory on my windows2003 server
Submitted: 2006-03-09 15:02 UTC Modified: 2006-03-09 17:05 UTC
From: jesper_bendtsen at yahoo dot dk Assigned:
Status: Not a bug Package: LDAP related
PHP Version: 4.4.2 OS: windows XP
Private report: No CVE-ID: None
 [2006-03-09 15:02 UTC] jesper_bendtsen at yahoo dot dk
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!!??

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-09 17:05 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 20:01:31 2024 UTC