Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/53462-solved-php-ldap-problems/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

  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.

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