Redis is installed under Windows (php use redis)

redis different and memecache are:
1, storage:
memecache the presence of all the data in memory, will hang after power failure, data can not exceed the memory size
redis have part on the hard disk, this will ensure persistent data, support persistent data (author note: there are two kinds of snapshots and logs AOF persistent way, when in actual use, paying particular attention to the profile snapshot parameters, or on the server is likely to make frequent full load dump).
2, data types supported:
Redis memecache much more than on the data support.
3, using different underlying model:
the new version of redis directly own built VM mechanism, because most of the system call system function, it will waste some time to move and requests.
4, different operating environment:
Redis currently only supports LINUX official line up, thus eliminating the need for support for other systems, so you can better used to focus on the optimization of the system environment, although there is a group for which Microsoft later He wrote a patch. But not put on the trunk

Personal sum up, there is persistent demand or data structures and processes have advanced application requirements, selection redis, other simple key / value store, select memcache.

redis php.ini needed extension Download:
https://windows.php.net/downloads/pecl/releases/redis/2.2.7/
http://pecl.php.net/package/igbinary

Installation Tutorial:
https://www.jianshu.com/p/0b03a3e05e1d
https://www.cnblogs.com/arxive/p/9301512.html
https://www.cnblogs.com/godlei/p/6502174.html

Redis is installed under Windows (php use redis)

<?php
$redis = new Redis();  
$redis->connect('127.0.0.1', 6379);//serverip port
$redis->auth('mypassword');//my redis password 
$redis ->set( "test" , "Hello World");  
echo $redis ->get( "test");

Guess you like

Origin blog.51cto.com/xuqin/2429730