Installing Redis and Phpredis modules under Linux

Source: Internet
Author: User

One: installation of Redis

1, First Officer network download Redis Compressed package, Address:http://redis.io/download Download

2, through the Remote management tool, the compressed package copy to the Linux server, to perform the decompression operation

3. go to Redis directory to perform make to compile files after Redis Decompression

4. after compiling, go to the SRC folder, execute make install for Redis installation, complete installation

II: deployment of Redis

after the installation is successful, the following Redis for Deployment

1, first for the convenience of management, the Redis file configuration files and common commands to move to the unified file.

MKDIR–P/USR/LOCAL/REDIS/{BIN,ETC}

2. Copy the installed redis configuration file and Redis executable to the new directory

CP ~/redis-3.2.6/redis.conf/usr/local/redis/etc

CP ~/redis-3.2.6/src/mkreleasehdr.sh Redis-benchmark redis-check-aof redis-cli redis-server Redis-check-rdb Redis-sentinel redis-trib.rb/usr/local/redis/bin/

3. Start redis-server service

vim/usr/local/redis/etc/redis.conf Modify daemonize change to Yes (allow background boot)

/usr/local/redis/bin/redis-server/usr/local/redis/etc/redis.conf

Three: PHP Extended Redis

Phpredis supports Redis extensions for PHP, PHP calls, and data written to Redis are done through Phpredis.

1, download phpredis,https://github.com/nicolasff/phpredis/downloads

2. Generate Configure file for Phpredis

Unzip Phpredis and enter this directory to execute /usr/local/php/bin/phpize production Configure file

3, implementation ./configure--with-php-config=/usr/local/php/bin/php-config

4, make && make install ( display the following information, indicating that the installation was successful )

Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

5. support redis module for PHP expansion

Vi/usr/local/php/etc/php.ini Add

[Redis]

Extension=redis.so

6. restart Nginx and php

Kill–hup ' Cat/usr/local/nginx/log/nginx.pid '

Service php-fpm Restart

Installing Redis and Phpredis modules under Linux

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.