Centos7 detailed tutorial on installing redis3.0 and phpredis extension (image text ),

Source: Internet
Author: User
Tags download redis

Centos7 detailed tutorial on installing redis3.0 and phpredis extension (image text ),

Sort out the process of installing redis3.0 and phpredis extensions on centos7. If you need them, you can use them.

1. Install redis3.0

1. install necessary packages

yum install gcc

2. Install redis on centos7

Cd usr/local/src
# Download redis #
Wget http://download.redis.io/releases/redis-3.0.0.tar.gz
# Decompress #
Tar zxvf redis-3.0.0.tar.gz
Cd redis-3.0.0
# Compile and add parameters to prevent make errors in Linux #
Make MALLOC = libc

The following message is displayed, indicating that redis is successfully installed.
For convenience, we can rename the redis-3.0.0
Mv redis3.0.0 redis

3. Start the redis service and test whether redis is normal.

Cd usr/local/src/redis
Cd src
# Starting the redis service #
./Redis-server/usr/local/src/redis. conf
As shown in the following figure, the redis service is successfully started.
# Testing redis #
Open another window, cd usr/local/src/redis/src
Open redis command line
./Redis-cli-h 127.0.0.1-p 6379
127.0.0.1: 6379> set name kidd
OK
127.0.0.1: 6379> get name
"Kidd"
Test successful
 

2. Install phpredis Extension

1. Make sure that php has been successfully installed

# Check the php version #
Php-v

2. Install the compilation tool

# Install the compilation tool #
Yum install wget make gcc-c ++ zlib-devel openssl-devel pcre-devel kernel keyutils patch perl

3. Install phpredis Extension

# Downloading the extension package #
Cd usr/local/src
Wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
# Decompress #
Tar zxvf phpredis-2.2.4.tar.gz
Cd phpredis-2.2.4
# Use phpize to generate the configure configuration file. If phpize reports an error, install php-devel #
/Usr/bin/phpize
./Configure -- with-php-config =/usr/bin/php-config
Make
Make install
After the installation is complete, the nstalling shared extensions:/usr/lib64/php/modules/
Vim etc/php. ini
Add extension = redis. so
Restart apache or nginx php-fpm

4. test whether the installation is successful.

Access the phpinfo. php file

The installation is successful, and the entire process is completed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.