Jump to content

Setting Up LDAP in PHP on Windows


Recommended Posts

Hi,

 

I am having an issue configuring LDAP to be enaled on my PHP installation.

 

I have PHP Version 5.2.14 on Windows 2007 Server (32 bit) and IIS.

 

PHP works fine and has done for a year or so now. However I am now trying to develop an application that will be  using LDAP protocools.

 

I have Googled around and followed all the various ideas, etc.

 

I have the php_ldap.dll, ssleay32.dll, libeay32.dll in the /ext directory and also in Windows/System32/

 

I changed the .dlls to be read/write by everyone. (Clutching at straws at this point).

 

In the php.ini file at the bottom I added the following:

 

[php_LDAP]

extension=php_ldap.dll

extension=libeay32.dll

extension=ssleay32.dll

 

They weren't present in the file. Not sure how PHP was installed as it wasn't me who did it, but I am guessing it was done by the installer.

 

I have restarted IIS, but still if it look at the PHPInfo it doesn't show LDAP as a "enabled" option.

 

Have I missed something?

 

Thanks. 

 

:confused: :confused:

 

Link to comment
Share on other sites

I don't know if this will help since we don't use IIS but here's how we do it:

 

function mylogin($username, $password) {
$password = addslashes($password);
$ldap = @ldap_connect("server.name.com") or die("Could not connect to LDAP server.");  // must be a valid LDAP server!
if ($ldap) {
	$bind_results = @ldap_bind($ldap,"cn=" . $username . ",o=tree_name", $password) or die("Please try again.");
	$dn = "o=tree_name";
	$filter="(|(cn=" . $username . "*))";
	$nds_stuff = array("title", "sn", "givenname", "mail");
	$results=ldap_search($ldap, $dn, $filter, $nds_stuff);
	$info = ldap_get_entries($ldap, $results);
	if ($info["count"] != 0) {	
		$_SESSION["login"] = Y;	


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.