#36670 [NEW]: Cant get any informations out of the Active Directory on my windows2003 server
| From: | jesper_bendtsen at yahoo dot dk | Date: | Thu, 09 Mar 2006 14:02:30 +0000 |
| Subject: | #36670 [NEW]: Cant get any informations out of the Active Directory on my windows2003 server | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-94096@lists.php.net to get a copy of this message | ||
From: jesper_bendtsen at yahoo dot dk
Operating system: windows XP
PHP version: 4.4.2
PHP Bug Type: LDAP related
Bug description: Cant get any informations out of the Active Directory on my windows2003 server
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!!??
--
Edit bug report at http://bugs.php.net/?id=36670&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36670&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36670&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36670&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36670&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36670&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36670&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36670&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36670&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36670&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36670&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36670&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36670&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36670&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36670&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36670&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36670&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36670&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36670&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36670&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36670&r=mysqlcfg