|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-20 09:59 UTC] luoy at muohio dot edu
compiling and installation was successful. But a single running of LDAP code failed.
configure options:
./configure --without-mysql --with-oci8 --with-apxs=/usr/local/apache/bin/apxs --with-ldap=/usr/local --enable-xslt --with-xslt-sablot=/usr/local --with-iconv --with-ssl=/usr/local/ssl --enable-libgcc
LDAP query test
Connecting ...connect result is Resource id #1
Binding ...
Warning: LDAP: Unable to bind to server: Can't contact LDAP server in /home/luoy/public_html/ldap.php on line 12
Bind result is
...
From LDAP server side, we did not see bind request ( Ususally we can if we use some native tools like ldapseach)
library dependence
[luoy@admsol03:/home/luoy/src/php-4.1.2]$ldd /usr/local/apache/libexec/libphp4.so
libdl.so.1 => /usr/lib/libdl.so.1
libpam.so.1 => /usr/dt/lib/libpam.so.1
libsablot.so.0 => /usr/local/lib/libsablot.so.0
libexpat.so.0 => /usr/local/lib/libexpat.so.0
libsched.so.1 => /usr/lib/libsched.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libldap.so.2 => /usr/local/lib/libldap.so.2
liblber.so.2 => /usr/local/lib/liblber.so.2
libresolv.so.2 => /usr/lib/libresolv.so.2
libm.so.1 => /usr/lib/libm.so.1
libclntsh.so.8.0 => /opt/oracle/product/817/lib/libclntsh.so.8.0
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
libwtc8.so => /opt/oracle/product/817/lib/libwtc8.so
libaio.so.1 => /usr/lib/libaio.so.1
/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
openldap-2.1.4 with this configuration ./configure --prefix=/var/ldap php-4.2.2 with this configuation: ./configure --with-ldap=/var/ldap Then upon running this code: <?php $basedn = "dc=example,dc=com"; $managerdn = "cn=Manager,$basedn"; $managerpassword = "secret"; echo "Connecting ...\n"; $ds=ldap_connect("localhost"); // must be a valid LDAP server! echo "connect result is ".$ds."\n\n"; if ($ds) { echo "Binding ($managerdn)..."; $r = ldap_bind($ds, $managerdn, $managerpassword); echo "Bind result is ".$r."\n\n"; ldap_close($ds); } ?> I get this error: LDAP: Unable to bind to server: Protocol error in /home/dkoopman/ldap_search.php Here is what the debug mode of my slapd shows: ldap_pvt_gethostbyname_a: host=devldap.example.net, r=0 connection_get(12): got connid=0 connection_read(12): checking for input on id=0 ber_get_next ldap_read: want=9, got=9 0000: 30 31 02 01 01 60 2c 02 01 01...`,.. ldap_read: want=42, got=42 0000: 02 04 1c 63 6e 3d 4d 61 6e 61 67 65 72 2c 64 63 ...cn=Manager,dc 0010: 3d 67 6f 64 61 64 64 79 2c 64 63 3d 63 6f 6d 80 =example,dc=com. 0020: 09 6c 64 61 70 31 32 33 34 35 .secret ber_get_next: tag 0x30 len 49 contents: ber_get_next ldap_read: want=9 error=Resource temporarily unavailable ber_get_next on fd 12 failed errno=11 (Resource temporarily unavailable) do_bind ber_scanf fmt ({imt) ber: ber_scanf fmt (m}) ber: >>> dnPrettyNormal: <cn=Manager,dc=example,dc=com> => ldap_bv2dn(cn=Manager,dc=example,dc=com,0) <= ldap_bv2dn(cn=Manager,dc=example,dc=com,0)=0 => ldap_dn2bv(272) <= ldap_dn2bv(cn=Manager,dc=example,dc=com,272)=0 => ldap_dn2bv(272) <= ldap_dn2bv(cn=manager,dc=example,dc=com,272)=0 <<< dnPrettyNormal: <cn=Manager,dc=example,dc=com>, <cn=manager,dc=example,dc=com> do_bind: version=2 dn="cn=Manager,dc=example,dc=com" method=128 send_ldap_result: conn=0 op=0 p=2 send_ldap_response: msgid=1 tag=97 err=2 ber_flush: 52 bytes to sd 12 0000: 30 32 02 01 01 61 2d 0a 01 02 04 00 04 26 72 65 02...a-......&re 0010: 71 75 65 73 74 65 64 20 70 72 6f 74 6f 63 6f 6c quested protocol 0020: 20 76 65 72 73 69 6f 6e 20 6e 6f 74 20 61 6c 6c version not all 0030: 6f 77 65 64 owed ldap_write: want=52, written=52 0000: 30 32 02 01 01 61 2d 0a 01 02 04 00 04 26 72 65 02...a-......&re 0010: 71 75 65 73 74 65 64 20 70 72 6f 74 6f 63 6f 6c quested protocol 0020: 20 76 65 72 73 69 6f 6e 20 6e 6f 74 20 61 6c 6c version not all 0030: 6f 77 65 64 owed What can be done? This appears to be a problem with the way PHP is interacting with ldap server. Notice the "version not allowed" commands in the slapd output. If I make an entry with the Manager dn using the tools that come with openldap, ldapadd, it shows that it is using version 3. Looks like PHP is using version 2, which openldap-2.1.4 does not like. What can be done? Can somebody create a patch for the ldap.c file? Help.