LDAP functions are not availalbe on your php

I have a successful installation of Dolibarr v10.0.7 running on an Ubuntu 18.04 LTS virtual machine on a bare-metal Hyper-V machine. Thus far, all my installations and everything have gone smoothly.

Because of the Dolibarr LDAP feature to integrate with an LDAP server, I have also recently built an LDAP server running on Ubuntu 18.04 LTS as well, using OpenLDAP. I have verified that I can login and access it using both phpLDAPadmin and LDAPSoft. It appears to be working fine.

However, once I got the LDAP server setup and confirmed that I could login and create users and groups, I turned on the module within Dolibarr to get the error in the title: “LDAP functions are not available on your php”. I get the same tooltip message when I attempt to click the “TEST USER SYNCHRONIZATION” button as well.

I have verified that php-ldap is installed. I checked that both my servers are up to date and upgraded. I have checked the Dolibarr forums as well as Ubuntu and LDAP forums. I have not yet found anything that would point me in a general direction to keep exploring the issue.

I believe the issue lies on my Ubuntu - Dolibarr server. While I am new to Dolibarr and to LDAP, I believe I have a pretty fair grasp on both. A little push in the right direction would be as good as an answer to my issue at this point. Any help would be appreciated!

1 Like

Hi SheppTech,

I am not sure I can help, not having the same architecture. I was just wondering whether

  1. You see enabled ldap support under Home/Admin Tools/About PHP. If not, you have to check whether your web server is properly loading php and related modules.

  2. You checked this page https://wiki.dolibarr.org/index.php/Install_and_configure_OpenLDAP which deals with OpenLDAP configuration. There appears to be some notes for Ubuntu.

Regards,
Marc

1 Like

Awesome response! I was not aware of looking for the settings in the Admin Tools section, and had not found that link about the configuration. I had only found the basic instructions on the Dolibarr wiki site.

However, after going to About PHP, i see that ldap and ldaps are both available, and it shows the LDAP is available in the PHP variables, which makes that warning even more confusing. Also, I verified that I can connect to the LDAP server via other platforms, but wanted to double check using the information in the link you sent. It appears that I am correctly configured.

Would you mind giving me your architecture details? Perhaps Ubuntu is a bad platform, or maybe there is a conflict in the compatibility somewhere.

Thanks Mark!

V/R
Jeff

Hi Jeff,

I rather use CentOS, but sometimes Ubuntu as well when more recent software version are needed…
There are philosophical reasons to chose which platform, but after some time, it essentially becomes a matter of habits… In the present case, I don’t think it matters, especially for something like ldap connectivity. My point was that I don’t have at hands the precise conditions you’re facing.

Anyhow, in case you haven’t done so, you could ssh to the ubuntu box and validate the ldap connectivity using a tool like ldapsearch. Sometimes you have stupid things like firewall, name resolution, etc and a command line tool may be more adequate to identify the source of the trouble. Once this works, it should be the same from within Dolibarr.

Regards,
Marc

1 Like

Interesting. I actually prefer CentOS but opted for Ubuntu because I could easily find tutorials on getting Dolibarr set up. I believe I could follow the same tutorial on CentOS. There are minor differences but the general structure should work.

I know there shouldn’t be a difference, but I will try installing on CentOS to see if I can get it to work.

Though this isn’t a solution, I appreciate the input. I’ll keep the topic unsolved in case anybody else wants to chime in.

Marc,

I have setup and configured Dolibarr on CentOS, but I am getting a bad gateway error for some reason. Any chance you’ve set it up behind a proxy before? I don’t understand what configuration it needs or why mine is wrong.

I appreciate your time!

Yes, my typical set up is behind a proxy.

Ok, I was not fully honest when saying my architecture is CentOS as I use nginx repository for serving webpages and Rémi Collet repository (https://blog.remirepo.net/) for php. That allows me to have rather up-to-date engines…

So basically, the proxy acts as a gateway, redirecting the request to the proper service based on domain name and suburi. On the dolibarr host, nginx receives the request and sends php calls to php-fpm.

Bad gateway error typical is the absence of reply which is most often a bad redirection somewhere (from the proxy to the host or from the host to the php engine) or a closed door in between (closed firewall).

Regards,
Marc

If you’re curious, I found a solution to the problem I was having.

For some reason, the install process skipped the php7.2-ldap package. I tracked that down, and it fixed the issue with the PHP warning.

Now, I can successfully connect to the server, but all the test sync processes fail. The system tells me that it placed a .ldif file on my server, but I searched low and high for it to no avail. Time to start digging all over again.

Hi Jeff,

Good to know you are making progress. Strange that it told you ldap was available without that package, but we face so many mysteries. Good luck at digging, the digger is unfortunately my daily essential tool as well !

Regards,
Marc