10

I'm trying to build a LDAP interface using php but have run into this strange problem. I have 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.

mr_abbasi
  • 143
  • 1
  • 1
  • 12

1 Answers1

29

Are you sure you have openldap included?

I just realized I have the same issue where phpinfo shows me several other ldap modules loaded by apache, but I do no have openldap

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

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

Instructions from link:

  • yum install php-ldap
  • vi /etc/php.ini
    • add extension=ldap.so
  • service httpd restart
dave4420
  • 46,404
  • 6
  • 118
  • 152
dgibbs
  • 411
  • 3
  • 4
  • 1
    Thanks @dgibbs its working for me :-) I have installed it for Linux 7 just hit _ yum install php-ldap_ and _service httpd restart_ – Ramesh Chand Jan 27 '16 at 08:06