|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-09-19 05:02 UTC] cm at financial dot com
Alos Tested with 4.3.0-dev.
$ds=ldap_connect("myserver") works var_dump($ds) gives "resource(X) of type (ldap link)"
ldap_bind returns "Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server".
The LDAP Server (OpenLdap) always shows an anonymous bind no matter if i bind with user or not. After each bind i get a mysql-service-lookup on that connection. Maybe something
like in bug #17350 with oracle ?
Chris
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
My script calls $ds=ldap_connect("my.ldap.server"); ldap_bind($ds); // or ldap_bind($ds,$my_user_dn,$my_user_pass) I expected PHP to return TRUE on ldap_connect() It gave me: "Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server" PHP Version 4.3.0-dev Configure Command './configure' '--with-mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-ldap' MySQL Support enabled Active Persistent Links 1 Active Links 1 Client API version 3.23.49 MYSQL_MODULE_TYPE builtin MYSQL_SOCKET /tmp/mysql.sock LDAP Support enabled RCS Version $Id: ldap.c,v 1.128 2002/09/05 11:22:20 hyanantha Exp $ Total Links 0/unlimited API Version 2004 Vendor Name OpenLDAP Vendor Version 20015Well it seems like ldap_connect has some problem. 1. Scenario $ds=ldap_connect($CONFIG["ldap_server"]); -> echo $ldap_error($ds) say "Success" but ldap_bind fails (also $ds is true and var_dump says "ressource (X) of type (ldap link)") 2. Scenario $ds=ldap_connect("ldaps://my.ldap.server"); -> echo $ldap_error($ds) say success and ldap_bind works. of course $CONFIG["ldap-server"] is defined as "ldaps://my.ldap.server" i checked that 3 times. So is this right that ldap_connect says everything is OK though it is not really ? ChrisWhen you use OpenLDAP 2 or other libraries that use the new LDAP API, ldap_connect() will only create some state on the client, the server is not contacted until you later do an LDAP operation like search or bind. There are no DNS lookups either, so ldap_connect("jlkdsfjsdk") will be successful. This means that ldap_connect() will almost always return true, while later operations might very well fail. Another difference worth noting, is that for anonymous access there is no more need for ldap_bind(). You just do your search.