PHP Startup: Unable to load dynamic library redis.so

Good morning everyone, I am writing to you because on my Nextcloud server, since the first installation I keep receiving the following error message:

php -v

PHP Warning: PHP Startup: Unable to load dynamic library ‘redis.so’ (tried: /usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so: undefined symbol: php_json_decode_ex), /usr/lib64/php/modules/redis.so.so (/usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

PHP 7.4.5 (cli) (built: Apr 14 2020 12:54:33) ( NTS )

Copyright © The PHP Group

Zend Engine v3.4.0, Copyright © Zend Technologies

with Zend OPcache v7.4.5, Copyright ©, by Zend Technologies

NOTE: I try to post server config details, but I’m unable to paste collected detail in right format, someone can provide me some hints about?

In the hope that someone can help me solve this problem (which fortunately does not affect the functionality of the system), I thank you in advance.
Regards.

Jeevan

Is the Redis-Server up and running?
What does ps aux | grep redis say?

redis -server -v

Redis server v=5.0.3 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=8c0bf22bfba82c8f

ps aux | grep redis
redis 1100 0.1 0.2 59152 11928 ? Ssl 09:05 0:19 /usr/bin/redis-server 127.0.0.1:6379
root 5096 0.0 0.0 12112 988 pts/0 S+ 13:51 0:00 grep --color=auto redis

I assume that you’ve updated php and therefore it is important to install all related php modules in the right version too. Make sure the php7(.4.5)-redis package is installed on your server and that all required libraries are installed too:

ls -al /usr/lib64/php/modules/redis.so
ldd /usr/lib64/php/modules/redis.so

Some more other detail that can be useful:

OS: CentOS Linux release 8.1.1911 (Core)

Filesystem Type Size Used Avail Use% Mounted on

/dev/mapper/cl-root xfs 40G 5.2G 35G 13% /

/dev/mapper/cl-home xfs 20G 171M 20G 1% /home

/dev/sdb1 ext4 126G 313M 119G 1% /media/nxc-data

php -v

PHP Warning: PHP Startup: Unable to load dynamic library ‘redis.so’ (tried: /usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so: undefined symbol: php_json_decode_ex), /usr/lib64/php/modules/redis.so.so (/usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

PHP 7.4.5 (cli) (built: Apr 14 2020 12:54:33) ( NTS )

Copyright © The PHP Group

Zend Engine v3.4.0, Copyright © Zend Technologies

with Zend OPcache v7.4.5, Copyright ©, by Zend Technologies

occ log:tail

PHP Warning: PHP Startup: Unable to load dynamic library ‘redis.so’ (tried: /usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so: undefined symbol: php_json_decode_ex), /usr/lib64/php/modules/redis.so.so (/usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0


Level App Message Time


Error PHP PHP Startup: Unable to load dynamic library ‘redis.so’ (tried: 2020-05-05T10:07:01+00:00
/usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so:
undefined symbol: php_json_decode_ex), /usr/lib64/php/modules/redis.so.so
(/usr/lib64/php/modules/redis.so.so: cannot open shared object file: No
such file or directory)) at Unknown#0

Follow the output of suggested commands:

ls -al /usr/lib64/php/modules/redis.so
-rwxr-xr-x 1 root root 703000 Mar 20 07:18 /usr/lib64/php/modules/redis.so

ldd /usr/lib64/php/modules/redis.so
linux-vdso.so.1 (0x00007ffc8a124000)
libzstd.so.1 => /lib64/libzstd.so.1 (0x00007fd36d0f1000)
liblzf.so.1 => /lib64/liblzf.so.1 (0x00007fd36ceee000)
libc.so.6 => /lib64/libc.so.6 (0x00007fd36cb2b000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd36d62d000)

…with more details…

ldd -v /usr/lib64/php/modules/redis.so
linux-vdso.so.1 (0x00007ffd3b7bc000)
libzstd.so.1 => /lib64/libzstd.so.1 (0x00007f600e93f000)
liblzf.so.1 => /lib64/liblzf.so.1 (0x00007f600e73c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f600e379000)
/lib64/ld-linux-x86-64.so.2 (0x00007f600ee7b000)

    Version information:
    /usr/lib64/php/modules/redis.so:
            libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
    /lib64/libzstd.so.1:
            libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/liblzf.so.1:
            libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
            libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
    /lib64/libc.so.6:
            ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
            ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2

I would recommend to ask aunt G. for some help on installing the php libraries and load it in the correct order. See e.g.

Thank you, but I had already seen these articles (which also refer to “older” versions of PHP… eg 7.2.x). I tried to apply the same advice but nothing has changed.
I’m still in the same situation over and over again…