You need to download the phpredis from redis website https://redis.io/download Once you’ve downloaded it, extract the files to phpredis directory. On Ubuntu, install the following extension.
cd phpredis
sudo phpize
sudo ./configure
sudo make
sudo make install
sudo phpize
sudo ./configure
sudo make
sudo make install
Add extension in php.ini.
extension = redis.so
Redis PHP installation is completed