Redis Installation and PHP installation Redis module

Source: Internet
Author: User
Tags php website redis server

I. Installation of Redis

1. Download

wget https://github.com/antirez/redis/archive/2.8.23.tar.gz

2. Decompression

TAR-ZXVF 2.8.23.TAR.GZCD redis-2.8.23/

3, because the Redis official has been configured for us, generated the makefile file, so we just make compile and install the line

Make Prefix=/usr/local/redismake Prefix=/usr/local/redis Install

4. Copy the Redis configuration file to the Redis installation directory

cp/usr/local/src/redis-2.8.23/redis.conf./

5. Start Redis

6. Review the process

Ps-aux |grep Redis

7. Connect Redis using Redis's own client tools

8. Here our Redis is installed, and the next step is to learn how to use Redis

9. Redis can be used as an init service, but it is not necessary to write directly in the boot file, and multiple Redis processes may be started on one server

# chkconfig:   2345 10# Description:  Redis is a persistent key-value databasepath=/usr/local/bin:/sbin:/usr/ bin:/binredisport=6379exec=/usr/local/bin/redis-serverredis_cli=/usr/local/bin/redis-clipidfile=/var/run/ redis.pidconf= "/etc/redis.conf" Case "$" instart) if [-F $PIDFILE]thenecho "$PIDFILE exists, process is already running O R crashed "Elseecho" starting Redis server ... "$EXEC $CONFfiif [" $? " = "0"] Thenecho "Redis is running ..." FI; STOP) if [!-F $PIDFILE]thenecho "$PIDFILE does not exist, the process is not running" elsepid=$ (cat $PIDFILE) echo "stopping. .." $REDIS _cli-p $REDISPORT Shutdownwhile [-X ${pidfile}]doecho "Waiting for Redis to shutdown ..." Sleep 1doneecho "REDIS s Topped "fi;; restart|force-reload) ${0} stop${0} start; *) echo "Usage:/etc/init.d/redis {start|stop|restart|force-reload}" >&2exit 1esac

 

chmod +x/etc/init.d/redischkconfig redis onchkconfig redis onchkconfig redis Stop
Second, compile the Redis module in PHP

1, install PHP Extension module can be downloaded on the PHP website http://pecl.php.net/

wget http://pecl.php.net/get/redis-2.2.7.tgz/usr/local/php/bin/phpize./configure--with-php-config=/usr/local/ Php/bin/php-configmake && make install# Modify PHP configuration file extension=/usr/local/php/lib/php/extensions/ no-debug-non-zts-20090626/redis.so# Restart PHP Service

  

 

  

  

Redis Installation and PHP installation Redis module

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.