Autheniticating PHP+LDAP+AD - stopped working.
Ran Yum Update on FC3 Linux server - which updated httpd, ldap, php etc. Afterward, the php code for a connection to the ldap server (windows 2003) stopped working, for Apache LDAP authentication and ldap
lookup.
error as follows:
Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in ldap_test.php on line 23
ldap_test.php:
------------------------------------------
<?php
$ldap_server = "ldap://10.0.0.3";
$ldap_base_dn = "cn=Users,dc=Company,dc=local";
$ldap_def_user = "cn=domain\user,cn=Users,dc=Company,dc=local";
$ldap_def_pass = "pword";
$ld_connect = @ldap_connect("$ldap_server");
ldap_set_option($ld_connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ld_connect, LDAP_OPT_REFERRALS, 0);
// the offending line below
$bind = ldap_bind($ld_connect, "hb\jtlawlor", "jaareL01");
if(!$bind) {
print "Cannot bind to ldap server. $ldap_server $ld_connect";
exit;
}
?>
This still works: (from the FC command line)
ldapsearch -x -D "domain\user" -s sub -b "cn=Users,dc=Company,dc=local" "(objectclass=user)" -w "pword"
Again, up until the update - this worked fine !!!
Server particulars:
--------------------------------------
Fedora 3 - standard install.
Apache, PHP and ldap were installed from rpm's - not compiled.
Windows 2003 - AD tree.
current verisons after update:
Apache (httpd) - 2.0.53
PHP Version 4.3.11
OpenLDAP Version 20213
Note: I have google searched this for the past two days... tried many different ways to connect and bind to the ldap server
Any Ideas? I may try install of FC4 on another box to see if that works.
John Lawlor.
jtlawlor[at]sbcglobal dot net
|