|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76967 Warning: ldap_control_paged_result_response(): No server controls in result
Submitted: 2018-10-03 17:13 UTC Modified: 2019-06-11 14:59 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: asears at conestogawood dot com Assigned: heiglandreas (profile)
Status: Closed Package: LDAP related
PHP Version: 7.0.32 OS: Gentoo Linux
Private report: No CVE-ID: None
 [2018-10-03 17:13 UTC] asears at conestogawood dot com
Tha pagination control does not work as expected. The server I'm connecting to is a Windows 2012 AD DC which does support pagination, but the LDAP extension does not seem to properly support it?

Test script:
$ldap = ldap_connect('');
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($ldap, '', 'password');

$cookie = '';
do {
    ldap_control_paged_result($ldap, 100, true, $cookie);
    $result  = ldap_search($ldap, 'DC=example,DC=com', '(primaryGroupID=513)', ['ou', 'sn', 'givenname', 'mail']);
    $entries = ldap_get_entries($ldap, $result);

    foreach ($entries as $e) {
        echo $e['dn'] . PHP_EOL;

    ldap_control_paged_result_response($ldap, $result, $cookie);
} while($cookie !== null && $cookie != '');

Expected result:
All of the members of GID 513 (Domain Users)

Actual result:
Stops after the first page with warning:
Warning: ldap_control_paged_result_response(): No server controls in result


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-03 17:27 UTC] asears at conestogawood dot com
Also, using Wireshark on the DC, I was able to verify that the pagination control was indeed sent in the request, and a cookie *was* returned in the results.
The disconnect seems to be somewhere between PHP receiving the results and ldap_control_paged_result_response parsing the server controls.
 [2018-11-01 07:47 UTC]
Can you provide some more details like PHP-Version, Operating System and underlying LDAP-Lib-version?
 [2018-11-01 07:47 UTC]
-Assigned To: +Assigned To: heiglandreas
 [2018-11-01 13:49 UTC] asears at conestogawood dot com
PHP version is 7.0.32 and OS is Gentoo Linux running kernel 4.19.
LDAP version info:
LDAP Support => enabled
RCS Version => $Id: 1c9340c77777426d718a7cb098b59b2827d2c21e $
Total Links => 0/unlimited
API Version => 3001
Vendor Name => OpenLDAP
Vendor Version => 20445
 [2019-06-10 20:10 UTC] asears at conestogawood dot com
Tested this today with PHP 7.2.19 and it seems to work fine now.
 [2019-06-11 14:59 UTC]
-Status: Assigned +Status: Closed
 [2019-06-11 14:59 UTC]
Thanks for the update!

So I'm closing this, since we won't do bugfixes for earlier versions anyway.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC