Problem with ldap and php on windows 2003 server
am 12.09.2009 08:38:28 von Anil Karat--0016e646065c37fa2604735bae23
Content-Type: text/plain; charset=ISO-8859-1
Hi
I have setup apache on windows 2003 and i work with php.
Now i tried to use the ldap client functions on php and tried to connect to
a local ldap server. I also tried to connect to some public ones. i was able
to connect to these servers and see information using standard ldap browsers
like "softerra ldap browser".However while trying to do so with php, i am
getting some wierd errors.
heres my code:
echo "attempting to connect
";
$ds=ldap_connect("localhost",50004);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS,0);
if ($ds){
echo "connect to ldap succesful!
";
$r=ldap_bind($ds);}
echo "Bind result is ".$r."
";
var_dump($r);
$sr=ldap_search($ldapconn, "cn=anil, ou=people, dc=localhost", "name=k*") or
die ("failed!");
$info = ldap_get_entries($ds, $sr);
echo $info["count"]." entries returned\n";
?>
what happens is on the apache server machine, a dialogue opens up after
sometime saying this-
"The instruction at 0x015a2188 refernced memory location 0x00000000.The
memory could not be "read""
Why does this happen?
if i remove the ldap_search, then the initial outputs of successful bind and
connect are displayed
I have copied those dlls to the correct directories and have enabled the php
ldap module. The module is getting loaded also according to phpinfo()
The issue is happening only when i enable that ldap_Search
please help
thanks
Anil
--0016e646065c37fa2604735bae23--