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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC