Problems with ldap_search in W2k3, can be solved adding
// -- $conn is a valid ldap connection.
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION,3);
ldap_set_option($conn, LDAP_OPT_REFERRALS,0);
before ldap_bind, as sad in http://bugs.php.net/bug.php?id=30670.