stuaz Posted September 30, 2011 Share Posted September 30, 2011 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: Quote Link to comment https://forums.phpfreaks.com/topic/248165-setting-up-ldap-in-php-on-windows/ Share on other sites More sharing options...
dougjohnson Posted September 30, 2011 Share Posted September 30, 2011 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; Quote Link to comment https://forums.phpfreaks.com/topic/248165-setting-up-ldap-in-php-on-windows/#findComment-1274466 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.