Copy the link address to be downloaded
wget http://download.redis.io/releases/redis-x.x.x.tar.gz
Warm reminder:Above The redis version number of the downloaded redis code is based on your own version. Don’t copy blindly.
a. Unzip
tar zxvf redis-x.x.x.tar.gz
b. Installation
cd redis-x.x.x make
c. After make is completed, the redis-related programs redis-cli and redis-server will be in the src directory
d. Copy redis-server and redis-cli to /usr/local/redis/bin(You can create the directory in advance)
e. Copy the redis configuration file redis.conf to /usr/local/redis
f. Configure the environment variable PATH,Add /usr/local/redis/bin
Password configuration requirepass xxxxxxxx (password)
Monitor bind 0.0.0.0 //Test environment
/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf &
/usr/local/redis/bin/redis-cli
1. Check whether the redis extension has been installed:
View phpinfo page or php -m | grep redis
2. Download the extension source code package:
PHP extension official website: pecl.php.net,Search redis
Select the stable version(stable) to download.
解压 源码包: tar xvf xxx.tgz 进入解压后的目录,依次执行 phpize ./configure make && make install
添加 extension = redis.so
systemctl restart php
查看phpinfo页面 或 php -m | grep redis
The above is the detailed content of How to install redis and redis extension on Ubuntu. For more information, please follow other related articles on the PHP Chinese website!