Hello,

My PHP-problem is, that I can't bind to a LDAP-Server, although 
ldap_connect seems to work. The script is intended for an 
authentification of web-users (which enter their username and password) 
by sending this data to a central ldap-server.
Openldap 2.1.12+Libs (Suse RPM) and OpenSSL (Suse RPM) are installed.

On the server which acted as "authentification server" (Redhat 9.0 (php 
4.2.2)) the same script works quite fine.

The firewall we use is configured with the same settings for our main 
server which I used for the "authentification server", so the connection 
should work from that part. The ports 389 and 636 are free if the 
connection goes to one of the two ldap-servers mentioned below.

My script looks the following way:

-------------------------------------------------------------------

$uid = $HTTP_POST_VARS['uid'];
$ldappass = $HTTP_POST_VARS['passwd'];
$basedn = 'dc=xxx, dc=de';
$ldaprdn  = 'uid='.$uid.', ou=xxx, dc=xxx, dc=de';
$ldapserver1 = 'ldaps://xxx.xxx.xxx.de';
$ldapserver2 = 'ldaps://xxx.xxx.xxx.de';

// connect to ldap server
$ldapconn = ldap_connect($ldapserver1) or die("Es konnte keine 
Verbindung mit dem LDAP-Server aufgebaut werden. Versuchen Sie es bitte 
spaeter nochmals");

if ($ldapconn) {

    $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);

    if ($ldapbind) { ....

--------------------------------------------------------------------

Beyond the $ldapbind line, several attributes are requested from the 
LDAP-server and used for statistical-information.

The script works until it reaches the $ldapbind = ldap_bind line, then I 
get the following message:

--------------------------------------------------------------------

Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP 
server in /xxxx/authenticate.php on line 22

--------------------------------------------------------------------

Tests with ldap_error show the following results:

ldap_connect: A resource ID
ldap_bind: success

(The latter is the most confusing one for me)

I looked at the PHP-documentation and searched via google, but I could 
find any clue, which could get this script going again.

How can I further determine, why the ldap_bind doesn't work properly ?

Thank you very much in advance.

With best regards.
        Patrique Wolfrum

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to