Installing and activating the module went without a hitch, but my first test today returned this error:
Fatal error: Call to undefined function: ldap_connect() in /mypath/modules/ldap_integration/ldap_integration/LDAPInterface.php on line 101
The code (lines 100-104):
function initConnection() {
if (!$con = ldap_connect($this->server, $this->port)) {
watchdog('user', 'LDAP Connect failure to ' . $this->server . ':' . $this->port);
return NULL;
}
Got this by logging in with DOMAIN\USER as well as just USER (which I think is what I should be using), same result both ways.
Drupal 5.1
Apache 2.0.55
PHP 4.4.2-1.1
MySQL 5.0.24a-Debian_9-log
I'm fairly certain that I inputted some values in LDAP Integration that are not yet correct, but looking at this error I have a feeling it's not related to the values I put on that page and must be something else.
One item of note: When I initially set up userid 1, the name was identical to the AD account under which I was testing, and was later changed in Drupal. I have noticed by browsing the database tables that Drupal holds onto the original string in another table, but I have to assume that LDAP is still going to look for the new user name and doesn't know/care about the original.
Another data point: I am currently logged into my site via Drupal authentication on the same machine where I attempt to login via AD authentication, but one session is through Firefox and one is through IE and the IE session was initially not yet logged in when I brought up the site.
Anyway, I have to assume this is not a result of anything being set incorrectly in Site configuration > LDAP Integration.
Comments
Comment #1
fams commentedhave you installed the php5-ldap module?
use phpinfo() to verify
Comment #2
fams commentedcreate a page with the folowing content.
name it info.php
put this page in the drupal root
access this page using a browser
search in the result for a ldap module
Comment #3
scafmac commentedSo I take it this was never an ldap integration problem?
Comment #4
kreaper commentedmarked for closing
Comment #5
kreaper commentedComment #6
kvguser commentedIn Windows environment, this error can be caused by old DLLs after all other settings are tuned the right way.
Checklist for fixing this error - http://www.incredium.com/php-ldap-connect-error
Comment #7
rarthi commentedI am experiencing the same issue on UNIX environment.
Is there a fix identified for this issue ?
Comment #8
rarthi commentedMy php.info file at the root of apache when viewed via the webbrowser is not showing up any ldap references.
I believe, I did not enable ldap support in the PHP version I have.
I am not sure how to enable LDAP support in PHP once already installed. Can you pls advise ?
Thanks in advance.
Comment #9
ggitsme commentedI had the same problem dans install the php5-ldap under ubuntu, then restart apache and it work fine. thanks
Comment #10
verta commentedSuggesting that the module check whether the LDAP module is loaded? I had my PHP.ini overwritten accidentally, and could not figure out why the test button and the module stopped working. Re-enabling extension=php_ldap.dll fixed it.
Is there a way to trap function: ldap_connect() not existing?
Just an idea, thanks!
Comment #11
nfg commentedThere is, actually. There's a function called "function_exists" that tells you, yes, if a function is defined. Maybe it could be used when installing the module so we could inform the user that their PHP install is missing LDAP support.
Comment #12
betamos commentedThe proper way to alert that system requirements are not met is via hook_requirements. Please consider adding that check to the module and also a function_exists('ldap_connect') to avoid fatal errors.
Also it would be awesome if there is a note in the README and on the project page about this dependency. Probably there are hosting services out there which don't support LDAP in their PHP configuration, so it is critical that all developers/webmasters who uses ldap_integration get to know about this.
Comment #13
johnbarclay commented