Installing LDAP support in PHP on Ubuntu server

LDAP support in PHP is not enabled by default. To enable LDAP support on an existing Ubuntu Apache web server you need to install php5-ldap package.

Install php5-lda:
sudo apt-get install php5-ldap
Reboot apache
/etc/init.d/apache2 restart

Be sure to enable LDAP support within PHP. Make sure that you have installed the necessary packages for your distro.

  • RedHat EL based distro (CentOS 4.3):
    yum install php-ldap
  • Make sure that /etc/php.d/ldap.ini contains
    extension=ldap.so
  • Ubuntu 6.06.1 (Dapper Drake) and others:
    sudo apt-get install php-ldap
    or possibly:
    sudo apt-get install php5-ldap
  • Other distros (/etc/php5/apache2):
    Modify php.ini, and uncomment the line:
     ;extension=php_ldap.so
    change to:
    extension=php_ldap.so
  • Windows:
    Modify php.ini, and uncomment the line:
     ;extension=php_ldap.dll
    change to:
    extension=php_ldap.dll
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s