Problem with ldap_connect()...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • celvane
    New Member
    • Mar 2010
    • 1

    Problem with ldap_connect()...

    I'm having a serious issue with ldap_connect. I have another server on which this code works, but it's a Windows box.

    PHP script (ad_test.php):
    Code:
    $ad_server = "fqdn.ad.forest";
    $ds_port = 389;
    $ad_conn = ldap_connect($ad_server, $ds_port); 
    echo ldap_errno($ad_conn) . ' : ' . ldap_error($ad_conn) . "\n";
    var_dump($ad_conn);
    Output:
    PHP Warning: ldap_errno(): supplied argument is not a valid ldap link resource in ad_test.php on line 5
    PHP Warning: ldap_error(): supplied argument is not a valid ldap link resource in ad_test.php on line 5
    :
    bool(false)

    I've tried connecting using ldap://server_name and ldap://ip_address. I've tried Active Directory and Sun ONE LDAP server. I've tried secured and unsecured. I've tried with and without port. I've tried 389, 636, ad 3268.

    Anyone have suggestions?

    Here is my environment:
    Server OS:
    SunOS host.domain.tld 5.10 Generic_142901-04 i86pc i386 i86pc
    Update 8, x86 virtual machine
    PHP version:
    PHP 5.2.9 (cli) (built: May 6 2009 21:48:48)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    PHP ldap extension:
    LDAP Support => enabled
    RCS Version => $Id: ldap.c,v 1.161.2.3.2.14 2008/12/31 11:17:39 sebastian Exp $
    Total Links => 0/unlimited
    API Version => 3001
    Vendor Name => OpenLDAP
    Vendor Version => 20339
    SASL Support => Enabled
Working...