php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22686 ldap_get_entries crash with no error.
Submitted: 2003-03-13 16:20 UTC Modified: 2003-03-14 13:20 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: pyrox_pro at hotmail dot com Assigned:
Status: Closed Package: LDAP related
PHP Version: 4.3.1 OS: RedHat 7.3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pyrox_pro at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-03-13 16:20 UTC] pyrox_pro at hotmail dot com
For a description that looks pretty, go here: http://www.phpbuilder.com/board/showthread.php?s=&threadid=10232112

This code worked awhile back. Seems like it was working a few versions back. Now it just dies, no errors to screen, no errors in apache logs, not one thing anywhere. The output just stops at the function: 

$info=ldap_get_entries($ds, $sr); 

For no apparent reason. At first I thought it was outdated libs, so I updated everything, openldap, openssl, php to 4.3.1 , ect. 
Still nothing. It just dies with no output or explanation. 


PHP:--------------------------------------------------------------------------------
$ds=ldap_connect("ldaps://".$ldap['SERV']."/");
$r=ldap_bind($ds,$ldap['user'],$ldap['pass']);
if(ldap_errno($ds)) die("<FONT COLOR=#ff0000>".ldap_error($ds));
$sr=ldap_search($ds,"OU=".stripslashes($agent).", ".$ldap['dn']."","CN=*");
if(ldap_errno($ds)) die("<FONT COLOR=#ff0000>".ldap_error($ds));
echo "Number of entires returned is ".ldap_count_entries($ds,$sr)."<p>";
echo "Getting entries ...<p>";
flush();
$info=ldap_get_entries($ds, $sr);
echo "Data for ".$info["count"]." items returned:<p>";
flush();
    for ($i=0; $i<$info["count"]; $i++) {
        echo "dn is: ". $info[$i]["dn"] ."<br>";
        echo "first cn entry is: ". $info[$i]["cn"][0] ."<br>";
        echo "first email entry is: ". $info[$i]["mail"][0] ."<p>";
    }
    echo "Closing connection";
flush();

--------------------------------------------------------------------------------


The output when run looks like this: 

Number of entires returned is 580 
Getting entries ... 

And thats it, just sudden death. I view the page source just to be sure. And like I said, there is squat in the logs about any errors. 

Much of this code is pulled directly from the manual or tutorials. 
It used to work, some event caused it to fail.
( I went from php 4.2.2 to php 4.3 ) 

I have searched google, the php.net bug lists, ect.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-14 09:53 UTC] pyrox_pro at hotmail dot com
Thank you, but now I have a complaint.

At least it does something besides dying, but it appears it cannot handle 580 items returned?

Fatal error: Allowed memory size of 9437200 bytes exhausted at (null):0 (tried to allocate 35 bytes) in /usr/docroot/dev/softrack/ldap.php on line 122

line 22 is of course:
$info=ldap_get_entries($ds, $sr); 

It this just a limitation I will have to deal with? 580 seems like a relativley low number?
 [2003-03-14 10:02 UTC] iliaa@php.net
Check your memory_limit setting, that is what probably limiting your memory usage to 9437200 bytes and thus preventing usage of more then 580 items.
 [2003-03-14 10:38 UTC] pyrox_pro at hotmail dot com
That is the 8mb standard, what do you suggest I raise it to then?
 [2003-03-14 10:42 UTC] iliaa@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. 

Thank you for your interest in PHP.

Depends on your needs, if you know you'll need to load 1000 elements to memory then 20 meg limit would probably be a good idea and so on...

Since this is not a bug in PHP I am closing this report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 16:01:31 2024 UTC