1. Introduction to Redis
Redis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and HASHS (hash type). These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic. Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. the difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis.
Redis is a high-performance Key-value database. The emergence of Redis, to a large extent, compensates for the lack of memcached such key/value storage, in some cases can be a good complement to the relational database. It provides the python,ruby,erlang,php client, which is very convenient to use.
The other does not say, first enter the theme:
1: First go to the official website to download Redis software package, I use is redis-2.4.2-win32-win64-fix.zip, according to your computer is 32 or 64 bit, choose a different package file, extract the following, later, I will put Redis.dll, and software packages and integrated Mysql+php+mysql all the software development package, upload my blog, there is a need to directly download
"1" Redis-2.4.2-win32-win64-fix.zip decompression as follows
"2" My Computer room 32-bit, you choose 32bit on the line, enter the directory as follows
This proves that Redis's service is installed OK,
But we want to use it in PHP, we also need to install the Redis module in PHP, the steps are as follows
Will download the appropriate DLL file to put the DLL files in Php/ext, in order, in fact, in the php.ini file can be mapped into the file
Implementation steps such as,
Next remember to put this two DLL file must be copied in the E:\wamp\bin\php\php5.4.16\ext directory,
Finally, to restart Apache,
Then in the PHP output echo phpinfo (), in the Phpinfo in the Redis module, it proves that your installation OK, the following can step into the world of Redis, slowly swim it!
$redis = new Redis ();
$redis->connect (' 127.0.0.1 ', 6379);
$redis->set (' Test ', ' Hello word redis ');
echo $redis->get (' Test ');
Var_dump ($redis);
I hope to be of some help to everyone