win redis

参考网址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

相关文章
相关标签/搜索