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

Installation steps for redis source code and phpredis extension

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Today, the editor will bring you an article that introduces the redis source code and the installation steps of the phpredis extension. The editor thinks it is very practical, so I will share it for you as a reference. Let's follow the editor and have a look.

First, we need to download the installation package. Download address:

Http://download.redis.io/releases/redis-5.0.5.tar.gz

Redis does not have any dependencies, so there is no problem with the general installation. If there is a problem, update gcc. The installation process is as follows:

1. Download the installation package

# wget http://download.redis.io/releases/redis-5.0.5.tar.gz

two。 Extract and install

It will take some time to compile the make. Please wait patiently.

# tar-zxf redis-5.0.5.tar.gz# cd redis-5.0.5# make # make PREFIX=/usr/local/redis install

3. Create a new redis configuration file directory and data storage directory

# mkdir / usr/local/redis/etc / usr/local/redis/var

4. Copy and modify the configuration file

# cp redis.conf / usr/local/redis/etc/# vim / usr/local/redis/redis.conf

If you find the daemonize no line, change no to yes, which means running in daemon mode to find dir, and changing it to / usr/local/redis/var to indicate that the data is stored in this directory.

4. Make soft links

Ln-s / usr/local/redis/bin/* / usr/local/bin/

5. Start redis and test if it is working properly

# systemctl start redis-server# redis-cli127.0.0.1:6379 > pingPONG

The presence of PONG means success.

Install the phpredis extension

The prerequisite must be that the server already has php installed. If there is no installation, install it first. Let's not talk about how to install php here.

The address of the installation package is here to see http://pecl.php.net/package/redis. Here I download the latest stable version

# wget http://pecl.php.net/get/redis-5.2.2.tgz

The installation steps are as follows:

1. Decompress

# tar-zxf redis-5.2.2.tgz# cd redis-5.2.2

two。 Run phpize

/ usr/local/php/bin/phpize

3. Installation

#. / configure-- with-php-config=/usr/local/php/bin/php-config # make# make install

4. Modify php.ini

Open the php.ini file and add a new line

Extension=redis

5. Check whether the extension is installed successfully

# php-m | grep redis

Check to see if a redis is present.

Turn off the redis service

You can use the systemctl command normally. One thing to note here is not to use kill-9 to kill. As a result, redis is not only not persistent, but also very easy to cause data loss.

On the redis source code and phpredis extension installation steps to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you like this article, you might as well share it for more people to see.

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

Database

Wechat

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

12
Report