Problem with ldap and php on windows 2003 server

Anil Karat <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
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:
<?php
echo "attempting to connect <br/>";
$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!<br/>";
$r=ldap_bind($ds);}
echo "Bind result is ".$r."<p>";
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.