This code worked awhile back. Seems like it was working a few versions back. Now it just dies, no errors to screen, no errors in apache logs, not a damned thing anywhere. The output just stops at the function:
$info=ldap_get_entries($ds, $sr);
For no apparent reason. At first I thought it was outdated libs, so I updated everything, openldap, openssl, php to 4.3.1 , ect.
Still nothing. It just dies with no output or explanation.
Someone please help? Anyone have any ideas?
Here is my glorious code:
$ds=ldap_connect("ldaps://".$ldap['SERV']."/");
$r=ldap_bind($ds,$ldap['user'],$ldap['pass']);
if(ldap_errno($ds)) die("<FONT COLOR=#ff0000>".ldap_error($ds));
$sr=ldap_search($ds,"OU=".stripslashes($agent).", ".$ldap['dn']."","CN=*");
if(ldap_errno($ds)) die("<FONT COLOR=#ff0000>".ldap_error($ds));
echo "Number of entires returned is ".ldap_count_entries($ds,$sr)."<p>";
echo "Getting entries ...<p>";
flush();
$info=ldap_get_entries($ds, $sr);
echo "Data for ".$info["count"]." items returned:<p>";
flush();
for ($i=0; $i<$info["count"]; $i++) {
echo "dn is: ". $info[$i]["dn"] ."<br>";
echo "first cn entry is: ". $info[$i]["cn"][0] ."<br>";
echo "first email entry is: ". $info[$i]["mail"][0] ."<p>";
}
echo "Closing connection";
flush();
The output when run looks like this:
Number of entires returned is 580
Getting entries ...
And thats it, just sudden death. I view the page source just to be sure. And like I said, there is squat in the logs about any errors.
Much of this code is pulled directly from the manual or tutorials.
It used to work, some unknown event caused it to fail. ( I went from php 4.2.2 to php 4.3 , which probably caused it. )
I have searched google, the php.net bug lists, ect, ect. And have no ideas.
For the love of god man, please help.