My PHP version: 5.3.10, Apache: 2.2.21, development environment: windows
1. First download the redis extension:
php_igbinary.dll
php_redis.dll
Download link:
http://pan.baidu.com/s/1c0nihUw
2. Add
extension=php_igbinary.dll
extension=php_redis.dll
3. Restart Apache and Test
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$res = $redis->set ('hello','kitty');
var_dump($res);
var_dump($redis->get('hello'));
echo $redis->get ('hello');
Result:
boolean true
string 'kitty' (length=5)
kitty
The above has introduced the PHP_Redis extension, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.