Installing Redis and Php-redis on the CentOS system under Linux

Source: Internet
Author: User
Tags install redis

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

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.