Jump to content

Can't contact LDAP server


dcparham

Recommended Posts

[if "flyhoney" is around, thx for previous help! thread is missing now, do not know why]

 

errormsg: "Can't contact LDAP server"

>using Ubuntu 8.04, PHP5, LDAP installed

 

ldap section in phpinfo:

ldap
LDAP Support 	enabled
RCS Version 	$Id: ldap.c,v 1.161.2.3.2.11 2007/07/17 09:09:42 jani Exp $
Total Links 	0/unlimited
API Version 	3001
Vendor Name 	OpenLDAP
Vendor Version 	20409
SASL Support 	Enabled

php code:

<?php
error_reporting(E_ALL);          // place these two lines at the top of 
ini_set('display_errors', 1);    // the script you are debugging
phpinfo();

$ldapHost = "ldap://ip of server goes here, and works - connects fine, and authenticates with below id and password/just does not "contact LDAP server"";
$ldapPort = "363";

$ldapUser = "ID";
$ldapPswd = "PASSWORD";
$ldapLink = ldap_connect($ldapHost) or die("Can't establish LDAP connection");
ldap_bind($ldapLink, $ldapUser, $ldapPswd) or die("Can't bind to the server");
//$results = ldap_search($ldapLink, $dn, "givenName=Abby");

$dn = "CN=Abby Normal,DC=anormal";

[line 22] 	$results = ldap_search($ldapLink, $dn, "givenName=Abby");
 	var_dump($results);	 	

?>

[output]

Warning: ldap_search() [function.ldap-search]: Search: Can't contact LDAP server in /var/www/ldapTest1.php on line 22

bool(false)

[/output]

is the port wrong? is the $dn correct? otherwise, what might be wrong?

any help is appreciated!

Link to comment
https://forums.phpfreaks.com/topic/164517-cant-contact-ldap-server/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.