I have written a php script to access my NDS using LDAP. Using php 4.3.4, Apache 2 on Windows XP Pro gave me no problems. However when I moved my scripts to a new server running on Linux with Apache 2 and php 4.3.10. I began experiencing problems. I am able to bind to the LDAP server but when I perform ldap_search, i sometimes get the error message 'No such object' and other times it works fine. It seems to me that this error happens randomly because i am still using the same test variables. Can anyone help me?
$ldap['conn'] = ldap_connect($ldap['host'], $ldap['port'] );
$ldap['base'] = '';
binding successful **
$ldap['result'] = ldap_search( $ldap['conn'], $ldap['base'], 'uid='.$ldap['user'] );
if( $ldap['result'] )
{
do something
}
else
{
// no such object originates here.
echo ldap_error( $ldap['conn'] );
exit;
}