#19281 [Opn]: OpenLDAP 2.1.4 requires version

From: Date: Mon, 09 Sep 2002 06:44:24 +0000
Subject: #19281 [Opn]: OpenLDAP 2.1.4 requires version
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18724@lists.php.net to get a copy of this message
ID: 19281 Updated by: venaas@php.net Reported By: mose@ns.cune.edu Status: Open Bug Type: LDAP related Operating System: RH 7.3, 2.4.19 PHP Version: 4CVS-2002-09-07 New Comment: I see your reasoning, but I'm opposed to this change. PHP always defaulted to v2 since the LDAP library did, and if one used v3 server one had to set the version. To use v3 do as follows before binding: ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); Previous Comments: ------------------------------------------------------------------------ [2002-09-07 10:37:36] mose@ns.cune.edu imap-2002.RC5 Apache 2.0.40 mysql 3.23.49 openldap 2.1.4 configure --with-apxs2=/local/apache/bin/apxs --enable-force-cgi-redirect --disable-cli --with-imap=/home/mose/imap-2002.RC5 --with-ldap --with-mysql=/local/mysql It appears that since version 2.1.3 of openldap, it requires that the LDAP version be set to 3 when making a connection. The php routines do not set the version. The following lines inserted in ext/ldap/ldap.c in the function ldap_connect() seem to work for me. int version; and then inside #ifdef LDAP_API_FEATURE_X_OPENLDAP ldap = ldap_init(host, port); } version = LDAP_VERSION3; (void)ldap_set_option (ldap, LDAP_OPT_PROTOCOL_VERSION, &version); #else Everyone should probably be using version 3. However, you may want to allow the version to be specified at configuration time or allow the version to be specified in php with the ldap_connect() call, with a default of version 3. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19281&edit=1

« previous php.bugs (#18724) next »