I try to bind LDAP using PHP and I getting this error

```
    Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server on line 21

```

and the script on line 21 is this..

```
    $bind_status = ldap_bind($conn_status, $app_user, $app_pass);

```

Here's the script to connect in LDAP:

```
   $conn_status = ldap_connect('ldaps://ldap.domain.com/', 389);
    if ($conn_status === FALSE) {
        die("Couldn't connect to LDAP service");
    } else {
        echo "Successful! <br/>";
    }

```

Here's the script of Bind to LDAP: 

```
    $app_user = 'cn=user, dc=domain, dc=com';
    $app_pass = 'password';

    $username = 'user'; //same as cn
    $password = 'password'; //same as $app_pass

    $bind_status = ldap_bind($conn_status, $app_user, $app_pass);
    if ($bind_status === FALSE) {
        die("Couldn't bind to LDAP as application user");
    } else {
        echo "Bind to LDAP successfully <br/>";
    }

```

My updated LDAP bind script

```
    $bind_status = ldap_bind($conn_status, $username, $password);
    if ($bind_status === FALSE) {
        //die("Couldn't bind to LDAP <br/>");
        echo "LDAP-Errno: " . ldap_errno($ds) . "<br />";
    } else {
        echo "Bind to LDAP successfully <br/>";
    }

```

And now I got this error:

```
    Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Operations error on line 21

```

Line 21 is this:

```
    $bind_status = ldap_bind($conn_status, $username, $password);

```

When I use

```
    var_dump (@ldap_bind($conn_status, "cn=Username, ou=domain, ou=com"));

```

The result is 

```
    bool(false)

```

Pls help me to fix this. Thank you