Php LDAP_OPT_DEBUG_LEVEL, 7 not tracing

2019-07-18 03:21发布

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.

标签: php logging ldap
1条回答
姐就是有狂的资本
2楼-- · 2019-07-18 03:57

You need to print out the errors using ldap_error($ds) after setting the option ldap_set_option. The following link http://ourlife01.blogspot.co.uk/2012/05/debugging-ldap-php-scripts.html has an example.

查看更多
登录 后发表回答