Ldap support

Hello, have you installed php extension for LDAP? If no, it is possible to activate it?

Thanks

There’s probably no way to add new plugins and extensions for php, you can see all the information in your phpinfo()

But there is ldap mentioned,
i can see it in phpinfo() in section curl/Protocols/ldap and also in the Module authors section.
But i am still getting an error : Call to undefined function ldap_connect().
How can i import that module? It looks like it is running on PHP server.

@jspindor said:
But there is ldap mentioned,
i can see it in phpinfo() in section curl/Protocols/ldap and also in the Module authors section.
But i am still getting an error : Call to undefined function ldap_connect().

curl/Protocols/ldap means you can use ldap:// URLs with cURL. The module authors always list the authors for all core PHP modules, regardless of whether the particular modules are enabled or not.

The actual LDAP module is not loaded, so you cannot use ldap_* functions.

@jspindor said:
How can i import that module? It looks like it is running on PHP server.

You can’t, selecting which PHP modules are enabled or not is a feature restricted to premium hosting. Our servers don’t have LDAP enabled, because LDAP is typically only used by large organizations, and large organizations typically don’t use free hosting.

Thanks, do you have some example for authentication with curl ldap? I cannot find any.

@jspindor First link in google

Thanks,

i was trying that, but i have following error:

  • Failed to connect to ldap.stuba.sk port 336: No route to host

this is my code :
$username = “…”;
$password = “…”;
$server = “ldap.stuba.sk”;
$port = “336”;
header ( “content-type: text/plain;charset=utf8” );
$ch = curl_init ();
curl_setopt_array ( $ch, array (
CURLOPT_PROTOCOLS => CURLPROTO_LDAP,
CURLOPT_PORT => $port,
CURLOPT_URL => $server,
CURLOPT_TIMEOUT => 4,
CURLOPT_USERPWD => ‘ou=People,DC=stuba,DC=sk,dc=’.$username.’,dc=username:’.$password
) );
if (curl_exec ( $ch )) {
echo “correct password”;
} else {
echo “maybe wrong password? curl got an error. errno:” . curl_errno ( $ch ) . '. error: ’ . curl_error ( $ch );
}
curl_close ( $ch );

Do you know what could be wrong?

Your target LDAP server is on a custom port? I’m sorry, but custom ports are blocked on our hosting.