#19494 [Opn]: ldap_bind() fails and doesnt use bind-dn

From: Date: Fri, 20 Sep 2002 18:47:06 +0000
Subject: #19494 [Opn]: ldap_bind() fails and doesnt use bind-dn
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19903@lists.php.net to get a copy of this message
ID: 19494 Updated by: venaas@php.net Reported By: cm@financial.com Status: Open Bug Type: LDAP related Operating System: Linux 2.4.17 PHP Version: 4.2.2 and 4.3.0-dev New Comment: I'm not so sure this is the problem, but are you running OpenLDAP 2.1 server? By default it only accepts LDAPv3 binds, and the API by default do LDAPv2 binds. IF you do, try to tell the API to use v3 binds using ldap_set_option(). Previous Comments: ------------------------------------------------------------------------ [2002-09-19 07:14:23] cm@financial.com >It's most likely some problem with your ldap server. >Have you tried to connect to some public ldap server? unlikely because i use it for nss_ldap and pam_ldap login on several machines also as i wrote in the very beginning it binds but without the given bind-dn >Also, try adding 'echo ldap_error($ds);' after the >ldap_connect() call. this prints "Success" ------------------------------------------------------------------------ [2002-09-19 07:00:00] sniper@php.net It's most likely some problem with your ldap server. Have you tried to connect to some public ldap server? Also, try adding 'echo ldap_error($ds);' after the ldap_connect() call. ------------------------------------------------------------------------ [2002-09-19 06:44:31] cm@financial.com My script calls $ds=ldap_connect("my.ldap.server"); ldap_bind($ds); // or ldap_bind($ds,$my_user_dn,$my_user_pass) I expected PHP to return TRUE on ldap_connect() It gave me: "Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server" PHP Version 4.3.0-dev Configure Command './configure' '--with-mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-ldap' MySQL Support enabled Active Persistent Links 1 Active Links 1 Client API version 3.23.49 MYSQL_MODULE_TYPE builtin MYSQL_SOCKET /tmp/mysql.sock LDAP Support enabled RCS Version $Id: ldap.c,v 1.128 2002/09/05 11:22:20 hyanantha Exp $ Total Links 0/unlimited API Version 2004 Vendor Name OpenLDAP Vendor Version 20015 ------------------------------------------------------------------------ [2002-09-19 05:37:30] sniper@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ------------------------------------------------------------------------ [2002-09-19 05:02:08] cm@financial.com Alos Tested with 4.3.0-dev. $ds=ldap_connect("myserver") works var_dump($ds) gives "resource(X) of type (ldap link)" ldap_bind returns "Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server". The LDAP Server (OpenLdap) always shows an anonymous bind no matter if i bind with user or not. After each bind i get a mysql-service-lookup on that connection. Maybe something like in bug #17350 with oracle ? Chris ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19494&edit=1

« previous php.bugs (#19903) next »