php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42684 ldap_connect never connects
Submitted: 2007-09-17 01:55 UTC Modified: 2007-09-18 01:24 UTC
From: djlift at mac dot com Assigned:
Status: Closed Package: LDAP related
PHP Version: 5.2.4 OS: hpux 11.11i
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: djlift at mac dot com
New email:
PHP Version: OS:

 

 [2007-09-17 01:55 UTC] djlift at mac dot com
Description:
------------
Whenever I try to connect to any ldap server in my network, I can never 
connect. I'm using openldap 2.3.38 on hpux 11.11i.

openldap command line binaries work fine.

Let me know what else i can provide.
Thanks,
Mark

Reproduce code:
---------------
<?php

// Connecting to LDAP
$ldapconn = ldap_connect("LDAP://10.10.2.50",389);

if (!$ldapconn) {
	echo "failure";
} else {
	echo "success";
}

?>

Expected result:
----------------
success

Actual result:
--------------
Warning: ldap_connect() [function.ldap-connect]: Could not create 
session handle: Unknown error in /opt/hpws/apache/htdocs/nissanq/
test.php on line 4
failure

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-17 02:05 UTC] djlift at mac dot com
I also tried to bind after connecting (just to see):

<?php

// Connecting to LDAP
$ldapconn = ldap_connect("LDAP://10.10.2.50",389);

$bind = ldap_bind
($ldapconn,"cn=solutionsldapproxy,ou=ldap,ou=services,o=nam","vac64mis
");

if (!$bind) {
	echo "failure";
} else {
	echo "success";
}

?>

because i read that nothing really happens until you attempt to bind 
but it still doesn't work.
 [2007-09-18 01:24 UTC] djlift at mac dot com
Nevermind...

I had to put this line in the apachectl file to load the shared library:
export LD_PRELOAD="$LD_PRELOAD:/usr/local/lib/libldap.sl"

This fixed my issue.
mark
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 04:05:52 2022 UTC