Enable " LDAP user and group backend" grayed out. This app cannot be installed because the following dependencies are not fulfilled: The library ldap is not available

Problem: Enable " LDAP user and group backend" grayed out.
This app cannot be installed because the following dependencies are not fulfilled:

  • The library ldap is not available

Environment: Nextcloud Installed on CentOS7 with embedded MariaDB.

I have tried installing php-ldap package and also added extension as below.

yum install php-ldap
vi /etc/php.ini
add extension=ldap.so
service httpd restart

Still I see that Enable Button Grayed Out. Please help me, it is eating my time.

You should check which php version you are using and if the module has correctly been loaded. This can easily been done by running a php script which contains the following code:

<?php phpinfo() ?>
1 Like

Output of php -m?

Also php -v?

Keep in mind that “php -m” will only return the modules loaded by the php cli program, but not the modules loaded by the web server :wink:

100% true. At least it will show whether php-ldap is actually installed?

No, not always. It only shows the module which have been enabled for the php cli. Depending on the system it might be possible that a different php.ini is used by the cli than the web interface. So that this is not a reliable way to check the module availability for the web access.

php -v?

PHP 7.2.10 (cli) (built: Nov 16 2018 15:24:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies

Hi J-ed, I ran this script and I am able to notice Ldap module is loaded. Below is the output for ldap module from the script <?php phpinfo() ?> output. Still the “Enable” button is grayed out. Also the output of “php -m” shows “ldap”

ldap
LDAP Support => enabled
RCS Version => $Id$
Total Links => 0/unlimited
API Version => 3001
Vendor Name => OpenLDAP
Vendor Version => 20444
SASL Support => Enabled

Directive => Local Value => Master Value
ldap.max_links => Unlimited => Unlimited

Have you executed the script in your web browser? The php cli access is most likely not the problem here.

Not sure how to do it. please help me with steps to do it, meanwhile let me also check how to run PHP script in browser.

Place it in a directory of your web server which can be access by a browser. E.g. if the web root is /var/www/htdocs you could create a php file in this directory and named it info.php. Next you open your web browser and enter the url to your server, like http://<your-server-fqdn>/info.php
As a result an html file should be shown.

This is the only way how you can check if a php module is correctly loaded!

Hi J-ed, Yes I tried and I see the below modules as loaded

util_ldap
mod_authnz_ldap
mod_php7

I’m missing a module named ldap, which is what the discussion is about.

Yes. I don’t see a module with name “ldap”. and from the APPs page of Nextcloud GUI the error is
" This app cannot be installed because the following dependencies are not fulfilled:

  • The library ldap is not available."

Please tell me what to do.

Modify the php.ini file on your web server so that the module is correctly loaded. Once you’ve managed this step I would expect that Nextcloud works as expected.

If I modify /etc/php.ini file to add “extension=ldap.so” I get below error when I run “php -m”.
PHP Warning: Module ‘ldap’ already loaded in Unknown on line 0

I also notice in PHP.ini " Note: packaged extension modules are now loaded via the .ini files found in the directory /etc/php.d; these are loaded by default."

If I go to that location and check, I find that the ldap extension is already available.

cd /etc/php.d

[root@testcentos php.d]# cat ldap.ini
; Enable ldap extension module
extension=ldap.so

[root@testcentos conf.modules.d]# pwd
/etc/httpd/conf.modules.d

[root@testcentos conf.modules.d]# cat 01-ldap.conf

This file configures the LDAP modules:

LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

The error shown is “library ldap is not available” not “ldap is not available”.

I am feeling like “library ldap” could be different than “ldap”.

You are still mixing up the php web and the php cli access. So don’t try to use the php command line interface (cli) to prove or test that the php web access has the ldap module loaded. Due to the fact that you are now getting an error message if you run the php cli, you
a) haven’t installed the required php module correctly.
b) most likely haven’t modified the correct php.ini file which is used by the php web access.

I hope we need not to edit as I have installed latest PHP and Nextcloud. However I have also tried editing for correct php.ini file. But no luck.

The error " * The library ldap is not available." is killing me.

Hi J-ed, Yes you were right. When I checked I saw three versions of PHP running in the server and the Web is to access PHP7.2 but PHP 7.2’s directory didn’t have ldap.so file, where as PHP 7.0 & 5.6 had the file/module.

Now I have made Apache to point/look at PHP 7.0 by renaming php_XX.conf files of both 7.2 and 5.6 versions.

Now the “enable” button activated and am able to Integrate AD with Nextcloud.

The new challenge is I have added the existing Windows File Servers’s shared folders as external storage where all AD users were given access with set certain permissions.

After adding the same folders as external storage through SMB/CIFS how can I enforce same Windows permission when accessed using AD user login.

The Idea was to have Open Source file sharing app/tool alternative to existing windows file/folder sharing. All AD users are given access with certain permissions to shared folders. How do I enforce the same access restrictions/permissions for the same share/folder when accessed through Nextcloud as an Active Directory User.

Your SMB problem is a different problem/request, so please mark this request as resolved and open a new one for it.