|  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.
Block user comment
Status: Assign to:
Bug Type:
From: djlift at mac dot com
New email:
PHP Version: OS:


 [2007-09-17 01:55 UTC] djlift at mac dot com
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.

Reproduce code:

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

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


Expected result:

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


Add a Patch

Pull Requests

Add a Pull Request


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):


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

$bind = ldap_bind

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

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

This fixed my issue.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 12:01:30 2024 UTC