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
 

tomek1979

Verified User
Joined
Apr 18, 2017
Messages
19
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
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,854
Location
GMT +7.00
Yes, you need to use full path to the pecl in order to compile a module for a specific PHP version.
 

Phuturist

Verified User
Joined
Dec 30, 2018
Messages
14
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?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,854
Location
GMT +7.00
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
 

Phuturist

Verified User
Joined
Dec 30, 2018
Messages
14
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.
 

ezrix

New member
Joined
Aug 24, 2019
Messages
1
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
 

lolfust1

Verified User
Joined
Oct 24, 2015
Messages
41
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
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,854
Location
GMT +7.00
Hello,

Did you restart OLS after the installation or redis completed?

Did you see redis when you run:

Code:
php -i | grep -i redis
?
 
Top