uogiene Posted September 30, 2006 Share Posted September 30, 2006 Hi,I'm having a little problem using LDAP over php in any way...Here's my current server setup:phpinfo relevant output[quote]Apache/1.3.33 (Win32) PHP/4.4.0 ldapLDAP Support enabled RCS Version $Id: ldap.c,v 1.130.2.13 2005/05/08 16:06:24 sniper Exp $ Total Links 0/unlimited API Version 2004 Vendor Name OpenLDAP Vendor Version 0 [/quote]As required I've uncommented following in php.ini[quote]extension=php_ldap.dll[/quote]I've also copied libeay32.dll and ssleay32.dll to my SYSTEM folderI'm using following code to query LDAP[code]<?php$ldaphost = "ldaps://10.176.40.10/";// Connecting to LDAP$ldapconn = ldap_connect($ldaphost) or die("Could not connect to {$ldaphost}");?> [/code]I just get a blank page...If I do some echo'ing in that code I get the echo output...Any ideas what could be wrong?It looks as if the LDAP is not enabled properlyThanks for your help! Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 30, 2006 Share Posted September 30, 2006 if you're not getting anything, you're probably connected just fine. ldap_connect() doesn't actually query anything at all, it simply attempts to make a connection to the server. you'll have to define your error checking a little more clearly to see if you're having any issues:[code]<?php$ldaphost = "ldaps://10.176.40.10/";$connection = ldap_connect($ldaphost);if (!$connection) { echo "Not connected!";} else { echo "Connection successful!";}?>[/code]once you are connected, you'll have to use ldap_bind() and other functions to actually run your queries agains the ldap server. Quote Link to comment Share on other sites More sharing options...
uogiene Posted September 30, 2006 Author Share Posted September 30, 2006 Thanks a lot your suggestion outputted:[QUOTE]Connection successful![/QUOTE] ;D Quote Link to comment Share on other sites More sharing options...
uogiene Posted September 30, 2006 Author Share Posted September 30, 2006 on the other hand[code]<?php$ldaphost = "ldaps://10.176.45.1/";$connection = ldap_connect($ldaphost);if (!$connection) { echo "Not connected!";} else { echo "Connection successful!";}?>[/code]gave same output...10.176.45.1 being ip that does not exsists...something is not right... ??? Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 30, 2006 Share Posted September 30, 2006 have you tried to actually connect and bind ldap to anything? without trying to [b]do[/b] something with it, it's going to be extremely difficult to know whether or not it's working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.