"LDAP module not present" (but it is!)

"LDAP module not present" (but it is!)

by Jaime Dougherty -
Number of replies: 7

We have installed 2.5.1.  In the authentication settings I enabled LDAP from the list of authentication plugins.  However, when I go to the settings page for this plugin to set it up, I receive this error message:

The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled if you want to use this authentication plugin.


I have verified that the LDAP folder (and php files therein) are actually present and made sure to enable it before trying to modify the settings, but I'm not having any luck getting Moodle to recognize this.  Any help would be greatly appreciated!

Average of ratings: -
In reply to Jaime Dougherty

Re: "LDAP module not present" (but it is!)

by Ken Task -
Picture of Particularly helpful Moodlers

Look at your php info page in Moodle.  Looking for php-ldap support.

On CentOS Linux servers, for example, a section in php info display shows Additional .ini files parsed and in the files listed in the box one can see /etc/php.d/ldap.ini.

Testing what mods are loaded or available, again from CentOS Linux server and from command line:

php -m |grep ldap

If using other OS, explore your php.ini file and search for anything related to ldap.

What you have found is present in all Moodle files.  LDAP is an option for authenticating.  But, for Moodle to be able to use, the ldap supports for PHP have to be installed and active.

'spirit of sharing', Ken

In reply to Jaime Dougherty

Re: "LDAP module not present" (but it is!)

by Albert Ramsbottom -
In reply to Albert Ramsbottom

Re: "LDAP module not present" (but it is!)

by Jaime Dougherty -

Thank you both for your help!  I have done some more digging and it appears that the file /etc/php.d/ldap.ini is no where to be found.   The documentation for "Troubleshooting AD and LDAP authentication" (Thanks, Albert!) said to find the line 'extension=php_ldap.dll' and remove the semi-colon, but that line is not included in php.ini.  Furthermore, 'extension_dir' doesn't seem to be set to a folder.  Before I request formal help from our IS resources (who are reluctant to support a system they did not select) I would like to know where I need to get the "php_ldap.dll" file that is missing to put into the folder (once I find it).  I just anticipate the IS contact expecting an explicit request rather than a general "help!" and really appreciate your sharing!

In reply to Jaime Dougherty

Re: "LDAP module not present" (but it is!)

by Ken Task -
Picture of Particularly helpful Moodlers

I could be wrong, but from 'are reluctant to support a system they did not select' sounds like it's NOT Moodle they 'object to' but the operating system upon which it is running.  So, is your server Windows (they use .dll files) or Linux (and if Linux, is it RedHat or CentOS or Ubuntu).

On a typical Windows installation the php_ldap.dll line in the php.ini is usually comment out by default.  The php_ldap.dll file is there just not activiated. 

On a typical Linux system, it uses other stuff (sparing you technical mumbo-jumbo), but there should be a /etc/php.d/ folder.  But there may not be a ldap.ini IF the php-ldap extension has not be installed.

So again ... what is operating system?

'spirit of sharing', Ken

 

In reply to Ken Task

Re: "LDAP module not present" (but it is!)

by Gary Morgan -

I'm having exactly these problems having just updated Moodle from 2.4 to 2.79, therefore needing to upgrade php to 5.4.43.  I'm on CentOS.  A lot of the people with this error seem to be experiencing it with Windows installs but mine isn't.  I can't find a /etc/php.d/ folder or a ldap.ini, but in the apache configuration, the LDAP box is ticked.  Any suggestions please?


In reply to Gary Morgan

Re: "LDAP module not present" (but it is!)

by Ken Task -
Picture of Particularly helpful Moodlers

@Gary ...

Am confused about your posting ....

So you are on CentOS and there is no /etc/php.d/ directory?

Are you on a shared Linux host?

If so, you may not have access to /etc/php.d/ where the .ini's reside for php extensions.

Contact service provider and inquire about php-ldap support.

Also, IF the Moodle server is remote, will your network/firewall folks allow an outside server (one not internal to your private network) access to LDAP server to query?

'spirit of sharing', Ken

In reply to Ken Task

Re: "LDAP module not present" (but it is!)

by Gary Morgan -

Much appreciated Ken, I've tracked down the problem now and it's a problem with the plugin not LDAP.  Thanks for your help.