ID: 14693 Updated by: venaas Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: LDAP related Operating System: Sun Solaris 2.7 (32 bit) PHP Version: 4.1.0 New Comment:
The problem has to do with continuation reference and which LDAP version you use. Most LDAP libs default to v2. Please try the following script (worked for me): $ds=ldap_connect("ds.carnet.hr"); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, 1); $r=ldap_bind($ds); $dn = 'dc=hr'; $filter="(o=*)"; $justthese = array( "dc"); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); ldap_close($ds); var_dump($info); I've told it to use v3, and also to follow referrals. You can probably omit the referrals setting, I think that's the default, but depends on library. I also suggest you try: $ds=ldap_connect("ds.carnet.hr"); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); $r=ldap_bind($ds); $dn = 'dc=hr'; $filter="(objectclass=*)"; $justthese = array( "dc"); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); ldap_close($ds); var_dump($info); I'm closing this since I don't think there's a problem. Reopen if you disagree. Previous Comments: ------------------------------------------------------------------------ [2001-12-25 17:08:01] [EMAIL PROTECTED] <script LANGUAGE="PHP"> $ds=ldap_connect("ds.carnet.hr"); $r=ldap_bind($ds); $dn = 'dc=hr'; $filter="(o=*)"; $justthese = array( "dc"); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); print $info["count"]." entries returned<p>"; ldap_close($ds); </script> Warning: LDAP: Unable to perform the search: No such object in /web/www/htdocs/ltest/bug.php on line 11 Warning: Supplied argument is not a valid ldap result resource in /web/www/htdocs/ltest/bug.php on line 13 entries returned - When puting $dn equal anything else then single signed base name (dc=<something>), script work without warning. ./configure --with-mysql --with-gd --with-ldap=/home/ldap/ldap --with-config-file-path=/usr/local/apache --prefix=/usr/local/apache --enable-ftp --with-ftp --enable-track-vars --with-apache=/opt/apache_1.3.22 --with-curl=/usr/local ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14693&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]