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:

 

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;	


Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.