|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25921 buggy example
Submitted: 2003-10-20 07:34 UTC Modified: 2004-09-24 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: corinl at gmx dot de Assigned:
Status: No Feedback Package: Documentation problem
PHP Version: 4.3.0 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: corinl at gmx dot de
New email:
PHP Version: OS:


 [2003-10-20 07:34 UTC] corinl at gmx dot de
Recently at my site they started to upgrade some directory servers and suddenly stuff started to break. All of them PHP'ish. All LDAP searches broke with "Operations Error". Doing the same queries with ldapsearch (openldap commandline tool) everything looked fine except that I could imagine something going on with the result as I got 'ref: ldap://,o=bar' back in the chunk coming from the server.

I found a 2-year old workaround for it here: (Surprisingly works flawless.)

Reproduce code:
        foreach($ldaphosts as $ldaphost)
                if( !$fail && !$success) 
                        if( $connect = @ldap_connect($ldaphost) )
                                if( $bind = @ldap_bind($connect,$ldapbinddn,$lda
pbindpasswd) )
                                        $filter = "($ldapuserattr=$username)";
                                        $search = @ldap_search($connect
, $ldapbasedn, $filter, array('cn'));
                                        $info = @ldap_get_entries($connect, $sea
                                                if(ldap_bind($connect, $info[0][
'dn'], $password) )
                                                        $success = 1;
                                                } else {

                                                        $fail = 1;
                                        } else {

                                                $fail = 1;


Expected result:
ldap_search() to return an ldap search resource to pass on to ldap_get_entries

Actual result:
ldap_search(): Search: Operations error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-20 07:41 UTC] bugs dot php dot net at phrenetic dot to
I forgot to supply LDAP client library version:

LDAP Support 	enabled
RCS Version 	$Id: ldap.c,v 2003/04/30 21:54:02 iliaa Exp $
Total Links 	0/unlimited
API Version 	2004
Vendor Name 	OpenLDAP
Vendor Version 	20123
 [2003-10-20 08:13 UTC]
That's not workaround, that's how you're supposed to do it.

 [2003-10-20 08:40 UTC] bugs dot php dot net at phrenetic dot to
Then this is a documentation bug. and doesn't say anything about this.
 [2003-10-20 09:32 UTC]
Besides the doc problem, it may also be a "real" bug.
Following draft-ietf-ldapext-ldap-c-api-xx.txt:
By default, this option is ON.

Is this option ON by default in PHP or not? Following this draft it should be, when not I consider this a bug.

Maybe it is a good idea to add the default options set by PHP to ldap_set_option/ldap_get_option.
 [2004-09-16 15:50 UTC]
Please explain what exactly do you miss in the documentation.
 [2004-09-24 01:00 UTC] phpdoc at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jun 13 00:01:24 2021 UTC