ldap_bind success WinXP with xampp but not Linux [SOLVED]

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

ldap_bind success WinXP with xampp but not Linux [SOLVED]

Postby JerseySmith » 19. December 2011 13:37

I can successfully do LDAP authentication with a PHP script running on XAMPP on Windows XP. But I copied this same script to an Apache on Linux Red Hat with no XAMPP and the ldap_bind call nows gives me the following error:

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server

My Windows XAMPP info is as follows:
Windows 5.1 Build 2600 Platform 2 Service Pack 3

PHP version: 5.3.8
Apache version: 2.2.21
LDAP: OpenLDAP, RCS Version: $ld: ldap.c 313665 2011/07/25 11:42:53, API version 3001, Vendor Version 20319

My Red Hat Linux box without XAMPP:
PHP version: 5.1.6
Apache version: 2.2.3
LDAP: OpenLDAP, RCS Version: $ld: ldap.c, v 1.161.2.3 2006/01/01 12:50:08, API version 3001, Vendor Version 20343

I can ping the LDAP server from both Linux and Windows machines.

I can telnet on the LDAP server with port 3268, so it doesn't seem to be a network connectivity issue…

Would anyone have any ideas?
JerseySmith
 
Posts: 6
Joined: 29. November 2011 14:32
Operating System: Windows XP

Re: ldap_bind success WinXP with xampp but not Linux

Postby JerseySmith » 19. December 2011 16:19

It is working now on the Linux machine.

Both the Windows and Linux machine were using OpenLDAP, but the LDAP on the Linux machine was not properly configured to connect to the LDAP server. The fix was to alter a file /etc/ldap.conf. The settings in this file were not correctly set. Trial and error altering the settings in this file to match what was used in Windows. The key setting seemed to be 'port'. 'port' in this file was originally set to 389, supposedly the default. Changed this to 3268. Restarted Apache and tried the authentication again and it worked. Also commented out 'base' parameter. Base not needed since LDAP is in a Windows domain.

This shows how good it can be to develop with XAMPP. XAMPP for Windows in this case had the proper LDAP settings so I could do LDAP calls from PHP without problems. On the Linux machine however, trial and error and half a day to get LDAP working properly. XAMPP can be a real time saver. Thanks XAMPP!!
JerseySmith
 
Posts: 6
Joined: 29. November 2011 14:32
Operating System: Windows XP

Re: ldap_bind success WinXP with xampp but not Linux

Postby Sharley » 19. December 2011 16:50

Thanks for the feed back. 8)

Best wishes. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 52 guests