How to enable LDAP with PHP 7.0 in Ubuntu server?

install both php ldap for your specific php version, mine was

sudo apt install php7.2-ldap php-ldap -y

it solves the problem i was having


Providing the php version number is no more required:

apt-get install php-ldap

Is enough now, the correct package version will be automatically installed.

PS: Note that is it true if you use the standard php packages provided by your distribution. If you are using an additional ppa for PHP like the sury one, you will have to specify the version number as there are multiple versions available.


To install ldap on a lamp with PHP version 7.0 (or 7.1):

  • apt-get install php7.0-ldap (or use apt-get install php7.1-ldap )
  • service apache2 restart
  • After that create a php file to get the php configuration phpinfo();
  • Now ldap is installed.

Tags:

Php

Ldap