I can run the following from the PHP 5.4.16 CLI:
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
$conn = ldap_connect($hostname);
ldap_bind($conn, $ldaprdn);
And I will get a lot of debug output to stderr that starts like this:
ldap_create
ldap_url_parse_ext(ldaps://ldap.example.com)
ldap_bind_s
ldap_simple_bind_s
ldap_sasl_bind_s
ldap_sasl_bind
ldap_send_initial_request
...
That is great for debugging on the CLI. However, I need to debug from within Apache 2.2.15 mod_php because I am seeing intermittent LDAP connectivity there that I cannot reproduce on the command line.
I thought I could run the same code from the web server and see that debug information in Apache's error log, but the messages are not showing up there. PHP errors/warnings are definitely going to the error log, and I tried error_reporting(-1)
, but can't get those debug messages to show anywhere.
Is there some way I can see those stderr debug messages when running under Apache?