2012-04-10 63 views
0

我正在運行以下命令並且失敗。它在die()處正確停止,但不會打印ldap_error()。PHP ldap_error什麼都不報告

// Now for LDAP 
      require_once('ldapconnect.php'); 

      $entry["mysqldbname"] = $value; 
      $result = ldap_mod_del($ldapconn, $binddn, $entry)or die(ldap_error()); 

我已經知道的連接是好的,因爲我以前在這裏測試,它也是工作的另一頁上就好了。任何想法爲什麼我的錯誤不打印?

回答

0

您必須指定連接,以便知道在哪裏尋找。

從:更改

$result = ldap_mod_del($ldapconn, $binddn, $entry)or die(ldap_error()); 

到:

$result = ldap_mod_del($ldapconn, $binddn, $entry)or die(ldap_error($ldapconn)); 

而現在我得到我所需要的故障排除錯誤。