I have recently upgraded Ubuntu to version 16.04 and PHP to version 7. However, the ldap connection is not working.
How to enable ldap in PHP 7?
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