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