saf Posted May 29, 2007 Share Posted May 29, 2007 Hi, I have been trying to connect to the Microsoft Active Directory in order to access user and user group information form authentication on one of my websites. When I execute the code below, I am able to connect but cannot bind. Please help me out. <?php $conn=ldap_connect("localhost") or die("Couldn't connect"); echo "Connect result is " . $conn . "<br />"; ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION,3); ldap_set_option($conn, LDAP_OPT_REFERRALS,0); $bind=ldap_bind($conn,'sarfaraz','password') or die("Couldn't Bind"); echo "Bind result is " . $bind . "<br />"; ldap_close($ds); ?> RESULT: Connect result is Resource id #2 Couldn't Bind I am currently developing this website on my personal computer (xp home, apache 2, php 5, mysql 5). I enabled the LDAP module in the php.ini, added php to the windows PATH, added libeay32.dll and ssleay32.dll to the system32 folder and restarted apache and the computer. Quote Link to comment https://forums.phpfreaks.com/topic/53462-solved-php-ldap-problems/ Share on other sites More sharing options...
Barand Posted May 29, 2007 Share Posted May 29, 2007 I found a great class called "adldap" and I always use that. Try googling "adldap". Quote Link to comment https://forums.phpfreaks.com/topic/53462-solved-php-ldap-problems/#findComment-264286 Share on other sites More sharing options...
saf Posted May 30, 2007 Author Share Posted May 30, 2007 Thanks for the help, but i'm not a big fan of using other people's classes...I am looking for a more direct solution. But once again thanks for the help (i'll take a look at the class anyways) Quote Link to comment https://forums.phpfreaks.com/topic/53462-solved-php-ldap-problems/#findComment-264412 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.