• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Contribution How to: Compile PECL Redis for PHP7

Zorrobyte

New Pleskian
Hello! This is one large command to:
1. Install Redis
2. Change to 4gb memory, allkeys-lru
3. Download, compile and install the Redis 7 PECL PHP Module
4. Start & Enable Redis Server on boot
5. Force reread of Plesk PHP modules

Works on CentOS 7 & Cloudlinux 7
Read, Edit, Run at your own risk!

cd && wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/e/ && rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-*.rpm && yum -y install redis && systemctl enable redis.service && sed -i 's/# maxmemory <bytes>/maxmemory 4gb/g' /etc/redis.conf && sed -i 's/# maxmemory-policy noeviction/maxmemory-policy allkeys-lru/g' /etc/redis.conf && systemctl start redis.service && yum -y install make plesk-php56-devel gcc glibc-devel libmemcached-devel zlib-devel plesk-php70-devel git && git clone https://github.com/phpredis/phpredis.git && cd phpredis && git checkout php7 && /opt/plesk/php/7.0/bin/phpize && PATH=/opt/plesk/php/7.0/bin:$PATH ./configure && make && sudo make install && echo "extension=redis.so" > /opt/plesk/php/7.0/etc/php.d/redis.ini && plesk bin php_handler --reread
 
@Zorrobyte,

This "large" command does a lot, but some commands are "not quite ok".

Nevertheless, it is good! At least for users that want a simple and ready solution for the usage of Redis with PHP 7.

Thanks........
 
Can we make step by step guide for Redis cache, since PECL stable redis is available for PHP7.

# yum install gcc plesk-php70-devel make
# /opt/plesk/php/7.0/bin/pecl install redis
# echo "extension=redis.so" > /opt/plesk/php/7.0/etc/php.d/redis.ini
# plesk bin php_handler --reread

That's all :)
 
Can we make step by step guide for Redis cache, since PECL stable redis is available for PHP7.
@trialotto maybe you can start a thread for it . I will be happy to help and test it.
https://pecl.php.net/package/redis

@moonlight,

You can follow the approach given by @IgorG.

Another more elaborate approach is to use a Vagrant machine to compile the Redis module, with this approach having the following advantages:

a) easy selection of PHP versions and compilation of the latest (PECL) package for the specific PHP version,

b) easy update of the Redis module, to include bug fixes (note: this is rather relevant when using a Redis cluster) and other code updates.

I will create a manual for this second approach, just give me some time to run through the steps.

Regards........
 
Thank you @IgorG and @trialotto

Could you also include Redis Stable server setup steps somewhere in your guide which will Help total newbies.
We can maybe cover at least cover 2-3 popular Distros.

For Centos 7 e.g.

yum install epel-release
yum install redis
sudo systemctl start redis.service
sudo redis-cli ping
(test output should be PONG)
sudo systemctl enable redis.service
Below some useful commands
sudo systemctl stop redis.service
sudo systemctl restart redis.service ( When making config changes)

Regards
moonlight
 
Last edited:
Back
Top