Method for installing the Redis extension under Linux under php


This example shows how to install the Redis extension under Linux for php. I will share it with you for your reference as follows:

Note: permissions for directory chomd 777-R

1. Install redis

Download: https: / / github com/nicolasff/phpredis/archive / 2.2.4 tar. gz

Upload phpredis-2.2.4.tar.gz to /usr/local/src

cd /usr/local/src # Enter the package store directory
tar zxvf phpredis-2.2.4.tar.gz # Unpack the
cd phpredis-2.2.4 # Go to the installation directory
/usr/local/php/bin/phpize # with phpize generate configure The configuration file
./configure --with-php-config=/usr/local/php/bin/php-config # configuration
make # compile
make install # The installation

When the installation is complete, the following installation path appears

/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/

2. Configure php support

vi /usr/local/php/etc/php.ini # Edit the configuration file at the end 1 Line to add the following

add

extension="redis.so"
:wq! # Save the exit

3 restart service

sudo service nginx restart
sudo /etc/init.d/php-fpm restart

I hope this article has helped you with your Linux server configuration.