[didn't see a problem/solution in the forum] -
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?
any help is appreciated!