Home > Database > Redis > How to install redis and redis extension on Ubuntu

How to install redis and redis extension on Ubuntu

王林
Release: 2023-05-26 17:52:40
forward
1355 people have browsed it

1. Download the latest source code package

How to install redis and redis extension on Ubuntu
Copy the link address to be downloaded

How to install redis and redis extension on Ubuntu

wget http://download.redis.io/releases/redis-x.x.x.tar.gz
Copy after login

Warm reminder:Above The redis version number of the downloaded redis code is based on your own version. Don’t copy blindly.

2. Unzip and install.

a. Unzip

tar zxvf redis-x.x.x.tar.gz
Copy after login

b. Installation

cd redis-x.x.x
make
Copy after login

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
How to install redis and redis extension on Ubuntu

f. Configure the environment variable PATH,Add /usr/local/redis/bin
How to install redis and redis extension on Ubuntu

3. Redis configuration(redis.conf& #xff09;

Password configuration requirepass xxxxxxxx (password)
Monitor bind 0.0.0.0 //Test environment

4. Start Redis

/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf &
Copy after login

5. Log in to Redis

 /usr/local/redis/bin/redis-cli
Copy after login

6. Installation successful

How to install redis and redis extension on Ubuntu

Install Redis extension

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
How to install redis and redis extension on Ubuntu
How to install redis and redis extension on Ubuntu
How to install redis and redis extension on Ubuntu
Select the stable version(stable) to download.

2. Compile and install

	解压 源码包: tar xvf xxx.tgz
	进入解压后的目录,依次执行
	phpize
	./configure
	make && make install
Copy after login

3. Modify php.ini

添加  extension = redis.so
Copy after login

4. Restart PHP-FPM

systemctl restart  php
Copy after login

5. Confirm

查看phpinfo页面
或  php -m | grep redis
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template