在使用 LDAP 函式之前,您需要知道...
您將使用的目錄伺服器的名稱或位址
伺服器的「基本 dn」(此伺服器上保存的世界目錄的一部分,例如「o=My Company,c=US」)
您是否需要密碼才能存取伺服器(許多伺服器會提供「匿名綁定」的讀取權限,但其他任何操作都需要密碼)
您在應用程式中進行的典型 LDAP 呼叫順序將遵循以下模式
ldap_connect() // establish connection to server | ldap_bind() // anonymous or authenticated "login" | do something like search or update the directory and display the results | ldap_close() // "logout"