Redis PHP extension in DA (php 56 and php 70 together)

tomek1979

Verified User
Joined
Apr 18, 2017
Messages
19
HI. How to add redis extension to php 70 and php 56.I use both php's in DA.
How to make redis extension work with it? I guess I need some compilation for it - but how
to compile it inside
/usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012/
/usr/local/php56/lib/php/extensions/no-debug-non-zts-20151012/

thanks for help
Tomek
 
Thanks for help. But I have some problem
All my compiled files are placed
in /usr/lib/php/20151012/ and I cannot generated .so with desired php in usr/local/php56 or php70
instead of desired /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226

How to overcome this?
Thanks so much for help
Tomek
 
Yes, you need to use full path to the pecl in order to compile a module for a specific PHP version.
 
Sorry for reviving such an old thread. I'm in the same boat. I know I should use the full path to pecl or use something like pecl -d php_suffix=7.2 install redis.

But when I do this I get the following error:

Code:
[root@vps ~]# pecl -d php_suffix=7.2 -d disable_functions= install -f redis
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading redis-5.0.1.tgz ...
Starting to download redis-5.0.1.tgz (243,524 bytes)
..................................................done: 243,524 bytes
25 source files, building
running: phpize7.2
sh: phpize7.2: command not found
ERROR: `phpize' failed

It works fine when installing on PHP71, which is the primary PHP version. How can I solve this?
 
On directadmin servers run as root:

Code:
cd /root
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh install redis
 
On directadmin servers run as root:

Code:
cd /root
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh install redis

Thanx once again Alex, this did the trick. I'm going to look at the script to see if I can learn something from it.
 
On directadmin servers run as root:

Code:
cd /root
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh install redis

hye i already run you script and manage to install the extension on php 7.2.. ho can i add the extension to php 7.3
 
On directadmin servers run as root:

Code:
cd /root
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh install redis

Hey i have installed redis php extension via Status -
./php-extension.sh status redis
[OK] The extension redis for PHP 72 seems to be enabled!
redis
Redis Support => enabled
Redis Version => 5.0.2
redis.arrays.algorithm => no value => no value
redis.arrays.auth => no value => no value
redis.arrays.autorehash => 0 => 0
redis.arrays.connecttimeout => 0 => 0
redis.arrays.consistent => 0 => 0
redis.arrays.distributor => no value => no value
redis.arrays.functions => no value => no value
redis.arrays.hosts => no value => no value
redis.arrays.index => 0 => 0
redis.arrays.lazyconnect => 0 => 0
redis.arrays.names => no value => no value
redis.arrays.pconnect => 0 => 0
redis.arrays.previous => no value => no value
redis.arrays.readtimeout => 0 => 0
redis.arrays.retryinterval => 0 => 0
redis.clusters.auth => no value => no value
redis.clusters.cache_slots => 0 => 0
redis.clusters.persistent => 0 => 0
redis.clusters.read_timeout => 0 => 0
redis.clusters.seeds => no value => no value
redis.clusters.timeout => 0 => 0
redis.pconnect.connection_limit => 0 => 0
redis.pconnect.pooling_enabled => 1 => 1
redis.session.lock_expire => 0 => 0
redis.session.lock_retries => 10 => 10
redis.session.lock_wait_time => 2000 => 2000
redis.session.locking_enabled => 0 => 0


but on installation got this -
Don't forget to run 'make test'.

Installing shared extensions: /usr/local/php72/lib/php/extensions/no-debug-n on-zts-20170718/
[OK] Installation of redis for bin completed!
ls: cannot access /usr/local/bin/lib/php.conf.d/*.ini: No such file or directory

using openlitespeed, with lsphp, also tried to check php extension on LSCWP its marked there is no redis php extension, any advice mate?
also checked DA file editor PHP both of them i have searched for Redis but added none to them
 
Hello,

Did you restart OLS after the installation or redis completed?

Did you see redis when you run:

Code:
php -i | grep -i redis
?
 
Was just looking at this. I know late reply but I couldnt get it to show so thought I would share just in case anyone else came along.

pkill lsphp as OLS runs in detached mode will reset the php and redis or any other extension you have loaded will now show.

You should also run pkill lsphp if you change the php version if you are running OLS
 
Back
Top