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

fams’s picture

have you installed the php5-ldap module?
use phpinfo() to verify

fams’s picture

Assigned: Unassigned » fams

create a page with the folowing content.

phpinfo();

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

scafmac’s picture

Priority: Critical » Normal

So I take it this was never an ldap integration problem?

kreaper’s picture

Status: Active » Postponed (maintainer needs more info)

marked for closing

kreaper’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
kvguser’s picture

In 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

rarthi’s picture

I am experiencing the same issue on UNIX environment.
Is there a fix identified for this issue ?

rarthi’s picture

My 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.

ggitsme’s picture

I had the same problem dans install the php5-ldap under ubuntu, then restart apache and it work fine. thanks

verta’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
Category: support » feature
Status: Closed (fixed) » Active

Suggesting 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!

nfg’s picture

There 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.

betamos’s picture

Category: feature » task
Priority: Normal » Critical

The 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.

johnbarclay’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.