PHP Startup: Unable to load dynamic library 'redis.so'

Operating System & Version
CENTOS 7.9
cPanel & WHM Version
92.0.10

SPDTeam

Member
Dec 4, 2020
20
2
3
UK
cPanel Access Level
Root Administrator
Hi all

I recently was trying out Redis and after the experiment I uninstalled it. Or so I thought.

I've just noticed several errors being recorded at the Account (website) level, in the error_log file.

Code:
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /opt/cpanel/ea-php74/root/usr/lib64/php/modules/redis.so (/opt/cpanel/ea-php74/root/usr/lib64/php/modules/redis.so: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php74/root/usr/lib64/php/modules/redis.so.so (/opt/cpanel/ea-php74/root/usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
I've checked for references to Redis in the PHP.ini (WHM >> MultiPHP INI Editor) but cannot see anything specific to Redis.

I've missed a step somewhere.

Any suggestions?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Hey there! Can you try running the following command to see if that shows you an entry for Redis directly in the configuration?

Code:
grep -R redis /opt/cpanel/ea-php74/root/etc/php.ini
If not, you may want to try a more general search of those areas with something like this:

Code:
[CODE]grep -Ri redis /opt/cpanel/ea-php*/root/etc/php.ini
[/CODE]
 

SPDTeam

Member
Dec 4, 2020
20
2
3
UK
cPanel Access Level
Root Administrator
Thanks, PRex

I eventually found the culprit.

It was in
Code:
/opt/cpanel/ea-php74/root/etc/php.d/redis.ini
line: extension=redis.so.

For now, I've commented the line out. Hopefully, that will stop the errors.

What would be the safe way to uninstall Redis and the EasyApache4 PHP extension? Assuming I don't just remove the redis.ini...

Hey there! Can you try running the following command to see if that shows you an entry for Redis directly in the configuration?

Code:
grep -R redis /opt/cpanel/ea-php74/root/etc/php.ini
If not, you may want to try a more general search of those areas with something like this:

Code:
[CODE]grep -Ri redis /opt/cpanel/ea-php*/root/etc/php.ini
[/CODE]
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
I'm glad that command helped to track it down.

Since Redis isn't something we support on our end, we don't have a recommended install or uninstall option. You may have seen this thread where this was discussed:


but none of those steps use cPanel tools as it's all done through the Yum and RPM system.