參考網址http://blog.csdn.net/wgw335363240/article/details/24469159,http://www.runoob.com/redis/redis-hashes.htmlhtml
1.cmd切換到目錄下:redis-server.exe redis.windows.confredis
2.redis-cli.exe -h 127.0.0.1 -p 6379 。windows
設置鍵值對 set myKey abcyii
取出鍵值對 get myKeyspa
增長到yii.net
'components' => [component
//file
'cache' => [
'class' => 'yii\caching\FileCache',
],
//memcache
'memcache' =>[
'class' => 'yii\caching\MemCache',
'servers' => [
[
'host' => 'localhost',
'port' => 11211,
'weight' => 60,
],
// [
// 'host' => 'localhost',
// 'port' => 11211,
// 'weight' => 60,
// ],server
],
],
//Redis
'redis' => [
'class' => 'yii\redis\Cache',
'redis' => [
'hostname' => 'localhost',
'port' => 6379,
'database' => 0,//默認有16個庫0-15,若是是集羣的話,只有一個0。
]
],htm
]blog