Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install redis and redis extensions in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How do I install redis and redis extensions in Linux? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

$wget http://download.redis.io/releases/redis-2.8.17.tar.gz$ tar xzf redis-2.8.17.tar.gz$ cd redis-2.8.17$ make

After make, the compiled redis service program redis-server appears in the redis-2.8.17 directory, and the client program redis-cli is used for testing. The two programs are located in the installation directory src directory:

Let's start the redis service.

$cd src$. / redis-server

Note that the default configuration is used to start redis in this way. You can also tell redis to start using the specified configuration file using the following command through the startup parameters.

$cd src$. / redis-server redis.conf

Redis.conf is a default configuration file. We can use our own configuration files as needed.

After starting the redis service process, you can use the test client program redis-cli to interact with the redis service. For example:

$cd src$. / redis-cliredis > set foo barOKredis > get foo "bar"

So the redis on linux is successfully installed, but an extension is needed. Keep going down ~ ~

Cd redis-3.2.1/ enter the redis directory Vi redis.conf / / configuration file bind 127.0.0.1 / / comment this out # bind liunx ip / / now someone else can connect to your redis

Install the Redis extension

Wget https://github.com/phpredis/phpredis/archive/2.2.8.tar.gz / / download redis extension tar xzf 2.2.8.tar.gz.1cd phpredis-2.2.8/ additional extension: whereis phpizeyum install php-devel / usr/bin/phpize./configure-- with-php-config=/usr/bin/php-configmakemake install / / next:

Modify php.ini

File cd ~ vi / etc/php.ini

Find extension and put this extension=redis.so in php.ini: wq

Systemctl restart httpd / / restart Apache extra extension: systemctl restart nginx.service / / restart nginx extra extension: systemctl restart php-fpm.service / / restart php-fpm to see what is the Linux system in the browser Linux is a free to use and freely spread UNIX-like operating system, is a POSIX-based multi-user, multi-tasking, support for multi-threading and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report