471,596 Members | 1,002 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

Secure LDAP bind fails php

Dear PHP Programmers,

Here is what I have:

PHP Version 4.3.8
LDAP Support enabled
RCS Version $Id: ldap.c,v 2004/06/01 21:05:33 iliaa Exp $
Total Links 0/unlimited
API Version 2004
Vendor Name OpenLDAP
Vendor Version 20122

I am trying to use LDAP to authenticate my users via LDAP. But I am
running into a problem...

When I try to use ldap_bind() with a secure connection (by specifiying
port 636), the page just hangs.

Here is my code:


$username = "fake";
$password = "fakepassword";

$reporting = error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR |

$ds=ldap_connect("ldap.byu.edu","636"); // must be a valid LDAP
if ($ds) {
echo "Binding ...";
$bind=ldap_bind($ds, "uid=" . $username . ",ou=People,o=usc.edu",
if ($bind == false) {
echo "BAD AUTH<br>";
else {
echo "bind=" . $bind . "<br>";
echo "userdn=" . $userdn . "<br>";
echo "AUTH OK<br>";
echo "Closing connection";
When I load it in a web browser, all I get is "Binding..." and it just
sits there.

If I change the port to 389, it works fine.
Any ideas?


Jul 17 '05 #1
1 2564
If I change the port to 389, it works fine.
Any ideas?

Am I the only person that has had this problem? Maybe someone out
there knows a better list to post this question?


Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Amar | last post: by
2 posts views Thread by Neil via .NET 247 | last post: by
3 posts views Thread by mbasil77 | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.