Jump to content
The Uniform Server Community

Rebuilding PHP with LDAP support


davil
 Share

Recommended Posts

anyone have any ideas about rebuilding PHP with LDAP support.

 

I've just very quickly glanced at the following site about integrating active directory and PHP:

 

http://www.developer.com/lang/php/article.php/3100951

 

and I would like to give it a go but am unsure how to rebuild PHP. just a quick basic tutorial will do fine. Is it as simple as running the exe with the correct parameters? if so I am sorted.

Link to comment
Share on other sites

just found out that I need to download the correct Dll version because I have two PHP folders unfortunately and the php_ldap.dll from my non - uniformserver doesn't work so I'll have to download the correct one I presume but this is no big deal.

Link to comment
Share on other sites

OK I cannot get the proper php_ldap.dll

I can get the one for PHP version 5.1.2 from PHP website but not for 5.1.1 (in version 3.3 of uniformserver) does anyone have a copy of PHP 5.1.1 that I could download? PLEASE PLEASE this would help my work so much.....

Link to comment
Share on other sites

ok I'm getting further in my project but still stumped by this LDAP . now I'm a bit of a n00b in this area so bear with me.

 

Now, I have the way my Domain is setup below:

example.jpg

 

For obvious reasons, I've renamed the domain and removed some of the containers or whatever they're called. Anyway, here's my code

 

<?php

   $dn = "OU=Users,DN=blah,DN=yah,DN=yakety,DN=ie";

   $attributes = array("displayname", "l");

   $filter = "(cn=*)";

   $ad = ldap_connect("ldap://mydomaincontroller")
            or die("Couldn't connect to AD!");
 
   ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);

   $bd = ldap_bind($ad,"myusername@blah.yah.yakety.ie","mypassword")
         or die("Couldn't bind to AD!");

   $result = ldap_search($ad, $dn, $filter, $attributes);

   $entries = ldap_get_entries($ad, $result);

   for ($i=0; $i<$entries["count"]; $i++)
   {
       echo $entries[$i]["displayname"]
            [0]."(".$entries[$i]["l"][0].")<br />";
   }
   ldap_unbind($ad);
?>

 

and all I get is:

Warning: ldap_search() [function.ldap-search]: Search: Operations error in W:\www\ad3.php on line 17

 

Warning: ldap_get_entries(): supplied argument is not a valid ldap result resource in W:\www\ad3.php on line 19

 

Can anybody please help me? I just need a basic example to show me how to interface with my AD - I'm nearly there I can almost taste it!

 

I've also tried

$dn = "OU=Users,DN=blah,DN=yah,DN=yakety,DN=ie";

$dn = "cn=Users,DN=blah,DN=yah,DN=yakety,DN=ie";

$dn = "DN=blah,DN=yah,DN=yakety,DN=ie";

$dn = "OU=Users,DC=blah,DC=yah,DC=yakety,DC=ie";

 

and none of these seem to work!!! What am I doing wrong? I'm sure that it's connecting to the server because when I tried with the wrong password it said incorrect credentials or something. PLEASE HELP!!!!!

 

P.S. I know this is no longer a uniform server issue but I just hope somebody here can help me...

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 1 month later...

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.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...