OpenLDAP Trouble?

Problems with the Linux version of XAMPP, questions, comments, and anything related.

OpenLDAP Trouble?

Postby whampton » 15. November 2004 21:41

Hey everyone! I have been racking my brain all day and I thought I would just finally post on here and ask the experts!

I have a test piece of code in PHP, basically just to test binding to an Microsoft Active Directory Server with a valid account, and I wrote it when I had XAMPP 1.4.5-1.4.7 installed and everything worked beautifully. I just installed the new 1.4.9a and now I get the following three errors:

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Unknown error in /opt/lampp/htdocs/active.php on line 69

Warning: ldap_search() [function.ldap-search]: Search: Unknown error in /opt/lampp/htdocs/active.php on line 70

Warning: ldap_get_entries(): supplied argument is not a valid ldap result resource in /opt/lampp/htdocs/active.php on line 71

Again this DID work up to 1.4.7. So anyway, I reverted to a backup of the /opt/lampp directory version 1.4.7 and the code worked fine once again. Then I tried using the upgrade script to 1.4.8, and once the upgrade finished, the code didn't work again. The section of code is below.

$ldap_user = "CN=someUSER,OU=Users,DC=new-albany,DC=k12,DC=oh,DC=us";
$ldap_pass = "somePASS";
$connect = ldap_connect($ldap_host, $ldap_port);
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
$bind = ldap_bind($connect, $ldap_user, $ldap_pass);

I have verified this on two separte machinges, although they are basically configured the same way. Both are Intel P4's, one is a desktop motherboard and another is a laptop. Does this have something to do with OpenLDAP 2.2.xx seemingly being introduced in XAMPP 1.4.8? Any ideas anyone? I am not ruling out operator error here...I may be missing something totally stupid so any help is much appreciated! Thanks so much in advance!

Wes
whampton
 
Posts: 2
Joined: 15. November 2004 21:20

Solved!

Postby whampton » 07. April 2005 20:36

Well, I finally revisited this problem again and played around with it some more and I have finally learned that the problem had to do with the LDAP Host parameter of the ldap_connect() function. I am sure this is documented somewhere, but for some reason, when I provided a fully qualified domain name (FQDN) for our Active Directory server, it was able to work up until XAMPP version 1.4.8, which then stopped working. From that point on I had to start using the IP address of the host instead of the FQDN. Very simple solution, but I still have no idea what causes this, and at this point I don't care, I'm just glad to have figured out a simple solution. I probably just missed this documentation, but for anyone else that has had this problem, that's all I had to do. Don't ask me why I didn't think to try that IP address 5 months ago, but I just didn't...
whampton
 
Posts: 2
Joined: 15. November 2004 21:20

Postby thedott » 15. April 2005 16:19

Thank you!!! This definitely solved the same problem for me too. I guess something in the new version has change so that ldap_connect() can't resolve the FQDN. What a major headache this has been. :?
thedott
 
Posts: 1
Joined: 15. April 2005 16:04

Postby jwest » 15. April 2005 22:18

how did you guys get the ldap functions enabled? I can't seem to get them loaded for some reason. :?

I'm running 1.4.13 on XP.

edit: nevermind, I figured it out (helps if you edit the right copy of php.ini), and it's working without needing to know the IP.
jwest
 
Posts: 1
Joined: 15. April 2005 22:11
Location: Texas


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 7 guests