Page 1 of 1

Unable to load dynamic library memcached.so RHEL8

Posted: Mon Dec 13, 2021 4:10 am
by sgomeztd
Hi,

I'm installing a new NagiosXI server on a RHEL8 and after following the memcached documentation https://assets.nagios.com/downloads/nag ... ios_XI.pdf I can see that memcached is running and the memcached-tools displays some information when executed. But when I run any command that involves php like reconfigure_nagios.sh or php -v I get the following warning:

PHP Warning: PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /usr/lib64/php/modules/memcached.so (/u sr/lib64/php/modules/memcached.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/me mcached.so.so (/usr/lib64/php/modules/memcached.so.so: cannot open shared object file: No such file or directory)) in Un known on line 0

If I do a "find / -name memcached.so" it is not found on the server so I guess there is some package missing.

Re: Unable to load dynamic library memcached.so RHEL8

Posted: Mon Dec 13, 2021 5:39 pm
by ssax
The php-memcached module is not available in the default repositories which is why it's failing, what is the output of this command on your RHEL system?

Code: Select all

yum info php-memcached
I was only able to find php-memcached in the REMI repo, I had to do this to get it to work:
- NOTE: This is installing the php 7.2 from the remi repo (a 3rd party repo)
- If you decide to try this take a VM snapshot/XI backup first just in case
- Remove your /etc/php.ini memcached line if you added it

Code: Select all

dnf install memcached libmemcached -y
systemctl enable memcached
systemctl start memcached
dnf install epel-release -y
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
dnf module reset php -y
dnf module enable php:remi-7.4 -y
dnf install -y php-pecl-memcache php-pecl-memcached
systemctl restart httpd php-fpm

Re: Unable to load dynamic library memcached.so RHEL8

Posted: Tue Dec 14, 2021 4:42 am
by sgomeztd
Hi,

As you mention, the php-memcached is not available on the oficial RHEL repos for php version 7, I have only found for php 5.x on https://access.redhat.com/downloads/con ... ge-browser

That package perl-Cache-Memcached.noarch you are installing from remis do exist on epel so I tried to install it but it does not seems to be what is required as I'm still getting the same warning and the memcached.so file does not exist.

Name : perl-Cache-Memcached
Version : 1.30
Release : 21.el8
Architecture : noarch
Size : 33 k
Source : perl-Cache-Memcached-1.30-21.el8.src.rpm
Repository : epel
Summary : Perl client for memcached
URL : https://metacpan.org/release/Cache-Memcached
License : GPL+ or Artistic
Description : Cache::Memcached - client library for memcached (memory cache daemon)

I have tested installing the package from remis but instead of doing the command "dnf module enable php:remi-7.4 " I kept version 7.2 as otherwise I was getting tons of incompatibility errors as dnf dectected I had version 7.2 installed. After installing those packages and restarting http and php-fpm services I get not a different error that seems does not look very promising as the packages are there but it gives and error when trying to read them.

root@deedcnagios01:~$php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /usr/lib64/php/modules/memcached.so (/usr/lib64/php/modules/memcached.so: undd symbol: php_json_decode_ex), /usr/lib64/php/modules/memcached.so.so (/usr/lib64/php/modules/memcached.so.so: cannot open shared object file: No such file orctory)) in Unknown on line 0
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
root@deedcnagios01:~$find / -name memcached.so
/usr/lib64/php/modules/memcached.so
/usr/lib64/php-zts/modules/memcached.so

Is this a particular error I'm having or the Nagios document I mentioned before is just not right?. I do not want to keep going down the rabbit hole of updating the php version, modules etc as that could lead to a los of potential errors in the future so I guess I will have to just uninstall memcache.

Re: Unable to load dynamic library memcached.so RHEL8

Posted: Tue Dec 14, 2021 7:44 pm
by ssax
I reported this to QA/development with the steps I took to make it work (only remi has the package that I could find which is 3rd party), they will need to make a determination on it.

Unfortunately, the perl package won't resolve it, only the php one will allow php to communicate with memcached.

I agree, at this point in time I wouldn't recommend implementing memcached on EL8.