Redis installation under CentOS

Source: Internet
Author: User
Tags download redis



Download Redis



Http://www.redis.cn/download.html



Download the Redis extension for PHP



Https://github.com/phpredis/phpredis#installation



Redis Official Online tutorial Installation

Download, extract and install:
$ wget http://download.redis.io/releases/redis-2.8.19.tar.gz
$ tar xzf redis-2.8.19.tar.gz
$ cd redis-2.8.19
$ make
The compiled executable is in the src directory. You can run Redis with the following command:
$ src / redis-server
You can connect to Redis using the built-in client:
$ src / redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
Install phpredis

[[email protected] server] # ls
mysql mysql-5.6.21 nginx nginx-1.4.4 php php-5.5.7 phpredis redis-2.8.19 redis-2.8.19.tar.gz
[[email protected] server] # cd phpredis /
[[email protected] phpredis] # ls
arrays.markdown config.w32 debian library.h package.xml redis_array.c redis_array_impl.h redis_session.h tests
common.h COPYING debian.control mkdeb-apache2.sh php_redis.h redis_array.h redis.c rpm
config.m4 CREDITS library.c mkdeb.sh README.markdown redis_array_impl.c redis_session.c serialize.list
[[email protected] phpredis] # / alidata / server / php / bin / phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
[[email protected] phpredis] # ./configure --with-php-config = / alidata / server / php / bin / php-config
[[email protected] phpredis] # make
[[email protected] phpredis] # make install
Installing shared extensions: / alidata / server / php / lib / php / extensions / no-debug-non-zts-20121212 /

Then add extension = redis.so in php.ini
Test code

<? php
    $ redis = new Redis ();
    $ redis-> connect (‘127.0.0.1’, 6379);
    $ redis-> set (‘helloredis’, ‘i am ok’);
    echo $ redis-> get (‘helloredis’);
?>


Redis installation under CentOS


Related Article

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.