php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30017 ldap_search set to no time limit dies with a timelimit expired warning
Submitted: 2004-09-07 22:58 UTC Modified: 2004-09-15 15:20 UTC
From: jon at lightsky dot com Assigned:
Status: Not a bug Package: LDAP related
PHP Version: 4.3.8 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jon at lightsky dot com
New email:
PHP Version: OS:

 

 [2004-09-07 22:58 UTC] jon at lightsky dot com
Description:
------------
I have called ldap_search with the optional time limit parameter set to 0 (documented as no limit) and I get this warning and no results.  The time limit parameter is #6. 

 PHP Warning:  ldap_search(): Search: Time limit exceeded in /exports/httpd_intra/ldap_test.php

I am connecting to an active directory tree.  When I first started working on the search limit on Active Directory was timing out and I was getting only a sub set of the results.  Since I had the search limit incresed I have started to get this warning.  My work arround is to set the timeout to a very long time and all of the results are returned.  But if time limit is set to 0 about half the times i get the warning and no results returned.  



Reproduce code:
---------------
ini_set('max_execution_time',20000);

$conn =  ldap_connect ("ldap://$url:3268");


$filter = '(ObjectClass=*)';
$base_dn = 'DC=foo,DC=bar';

echo "<BR>ldap bind: ". (ldap_bind($conn,$user_dn,$pass) ? ' goooooooood':'bad'

$sr   = ldap_search($conn, $base_dn,$filter,array(),0,0,0);   

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

print_r($info);


Expected result:
----------------
to see gooooooooood printed at the top of the page and then the text of 53000 entries.  

Actual result:
--------------
<BR>ldap bind:  goooooooood

PHP Warning:  ldap_search(): Search: Time limit exceeded in /exports/httpd_intra/ldap_test.php on line 82

PHP Warning:  ldap_get_entries(): supplied argument is not a valid ldap result resource in /exports/httpd_intra/ldap_test.php on line 90


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-15 15:20 UTC] sniper@php.net
RTFM: "The seventh parameter timelimit sets the number of seconds how long is spend on the search. Setting this to 0 means no limit. NOTE: This parameter can NOT override server-side preset timelimit. You can set it lower though."

1. It's 7th parameter.
2. You can NOT override any server-side limits..

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC