PHP-LDAP RPM Installed But Not Usable

Home » CentOS » PHP-LDAP RPM Installed But Not Usable
CentOS 2 Comments

Hi folks.

I’ve installed PHP 8.0 on my server, and just installed php-ldap. All looks to have worked fine.

php-common-8.0.28-1.el7.remi.x86_64
php-8.0.28-1.el7.remi.x86_64
php80-php-common-8.0.28-1.el7.remi.x86_64
php80-php-ldap-8.0.28-1.el7.remi.x86_64
php-cli-8.0.28-1.el7.remi.x86_64
php-sodium-8.0.28-1.el7.remi.x86_64
php80-runtime-1.0-3.el7.remi.x86_64

However, when I try to  use LDAP in a script, it says the ldap_connect function is not available:

[root@testsvr ~]# ./ldapAuth.php gary.stainburn fake-password PHP Warning:  PHP Startup: Unable to load dynamic library ‘ldap’ (tried:
/usr/lib64/php/modules/ldap (/usr/lib64/php/modules/ldap: cannot open shared object file: No such file or directory),
/usr/lib64/php/modules/ldap.so (/usr/lib64/php/modules/ldap.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Fatal error:  Uncaught Error: Call to undefined function ldap_connect() in /root/ldapAuth.php:12

Can anyone see what I’ve missed?

2 thoughts on - PHP-LDAP RPM Installed But Not Usable

  • Hello,

    it looks like you may be crossing the streams here.

    Remi has two flavours of PHP RPMs. One made to be installed standalone and one which supports multiple versions in parallel.

    From the output below it seems that you have a mixed setup, where such issues would not surprise me. You should either have php* packages or php80-php* packages, not both.

    Kind regards,
    Steve

    Am 20.03.2023 16:47, schrieb Gary Stainburn: