Jump to content

[SOLVED] PHP LDAP problems


saf

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

Archived

This topic is now archived and is closed to further replies.

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