SOURCE Address: http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm//This is the CentOS 6 version
Install the input command:
Step One:
# wget http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm# RPM-IVH epel-release-6-8. noarch.rpm# yum Install redis php-/etc/init.d/redis start // installation successfully started Redis
Step Two:
# vim/etc/sysconfig/iptables / / Configure firewall 6379 -j ACCEPT // Add this line in Iptables, open 6379 port (6379 for Redis default port)# service iptables restart // Restart service
Step Three:
# vim/etc/redis.conf // Open redis configuration file 127.0. 0.1 // Note, add #---Extranet access # service Redis restart // Restart service
Step Four:
# cd/usr/lib64/php/modules/'extension=redis.so'// introduced redis.so # Vim/etc/php.d/redis.ini // Remove the front single quotation mark (i.e. remove the comment)// restart Apache
Test:
# redis-CLI 127.0. 0.1:6379set"Hello" // assignment 127.0. 0.1:6379get"Hello" // value
PHP Code:
<? New Redis (); $redis->connect ('127.0.0.1',6379 $redis,set('a','Hello' ) ); Echo $redis,get('a');? >
Version Ps:window
Cmd:https://github.com/dmajkic/redis/downloads
Service installation package: Https://github.com/rgl/redis/downloads
Installing Redis and Php-redis on the CentOS system under Linux