Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Rebuilding PHP with LDAP support

Featured Replies

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.

  • Author

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.

  • Author

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

  • Author

Thanks again for all your help. I'll keep you guys posted on my results.

  • Author

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

  • 2 weeks later...
  • 1 month later...
  • Author
Ever try connecting to the ##php channel on the Freenode IRC Server?

2566[/snapback]

nope. what's the server address?

  • 1 month later...
  • Author

It's strange, I never really use IRC (even though I'm a computer technician and live on my PC) - I must give it a go. Thanks

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.