I am working on Red Hat Enterprise Linux Server release 6.0 (Santiago).
I've installed Apache, Php, Open Ldap etc and wrote a chunk code authenticating users across our ldap server over secure port which was working fine without any error a week ago.
Now I try this and gives me error PHP Warning:  ldap_search(): Search: Can't contact LDAP server in /full_path/login_script.php on line 11
I added ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); before I create connection to ldap server which gives me following output in error_log file.
put_filter: "(myLoginAttribute=testlogin@mydomain.edu*)"
put_filter: simple
put_simple_filter: "myLoginAttribute=testlogin@mydomain.edu*"
put_substring_filter "myLoginAttribute=testlogin@mydomain.edu*"
ldap_build_search_req ATTRS: *
ldap_new_connection 1 1 0
ldap_connect_to_host: TCP ldap.mydomain.edu:636
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying ldap_server_ip_address:636
ldap_pvt_connect: fd: 3 tm: -1 async: 0
ldap_close_socket: 3
PHP Warning:  ldap_search(): Search: Can't contact LDAP server in /full_path/login_script.php on line 11

I've tried to execute the script from command line using php command and that works fine, but when I hit it from web browser it doesn't authenticate use and leaves the errors in error_log file.

I've been trying to find what has changed on my server since this was working absolutely fine with no error at all.  It's very strange that it just stopped working without me touching any thing on the server where the script is running.

I'll really appreciate any type of help over this.
Thanks to all who can be helpful.