Using php-ldap on Centos 6.3

I am trying to create an LDAP interface using php, but ran into this weird problem. I installed the php-ldap package using yum on my base php install, but whenever I call ldap_connect (), it says the function is undefined. Seeing phpinfo (), I can verify that the ldap extension is indeed installed and enabled.

+8
php centos openldap
source share
1 answer

Are you sure you have openldap enabled?

I just realized that I have the same problem when phpinfo shows me some other ldap modules loaded by apache, but I don't have openldap

http://www.php.net/manual/en/ldap.installation.php

I just got a successful installation by following the directions here: http://www.aoddy.com/2009/01/18/how-to-install-php-ldap-module-on-centos5/

Link instructions:

  • yum install php-ldap
  • vi /etc/php.ini
    • add extension=ldap.so
  • service httpd restart
+23
source share

All Articles