I'm trying to get ldap_bind to trace out what its doing. I have the following
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
putenv('LDAPTLS_REQCERT=never');
error_reporting(E_ALL);
ini_set('display_errors', 1);
$ds = ldap_connect($server);
$r = ldap_bind($ds, $admin, $passwd);
I removed some code setting up variables. However I want to see the trace statements to help trouble shoot another issue.
You need to print out the errors using
ldap_error($ds)
after setting the optionldap_set_option
. The following link http://ourlife01.blogspot.co.uk/2012/05/debugging-ldap-php-scripts.html has an example.