First, install a software called composer.
Install the process has a choice button called Browe Choose your phpstudy inside the PHP inside of the php5.6.27 inside ext php.exe (like), (version preference php5.6),
Then the idiot installs open cmd, enters composer, then enters into your phpstudy in your project directory, then enters the input composer SelfUpdate, finds Composer.json under the Yii framework, yiisoft/ Yii2-swiftmailer, add "Yiisoft/yii2-smarty" below: "*", "Yiisoft/yii2-redis": "*", then find yiisoft/yii2/ Composer.json Bower-asset/yii2-pjax ":" ~2.0.1 ", below the" Yiisoft/yii2-smarty ":" * "," Yiisoft/yii2-redis ":" * " Then go into Common's main-local.php and write ' redis ' = [' class ' = ' yii\redis\connection ', ' hostname ' = ' 127.0.0.1 ', ' Port ' =& Gt 6379, ' database ' = 0,//has 16 library 0-15 default, if it is a cluster, there is only one 0. ], then go to cmd, enter composer update--prefer-dist Yii-soft/yii2-redis, and enter the controller after loading $redis = Yii:: $app->redis; $redis->set (' City ', ' Beijing '); $value = $redis->get (' City '), ture); Echo ' The value of city in Redis is: ', $value; Then look at the browser effect. (Example $ar =json_encode ($array); $redis = Yii:: $app->redis; $redis->set (' City ', $ar); $value = Json_decode ($redis) Get (' City '), true); return $this->render (' Index ', [' list ' = + $value]);)!!! The second effect is only applicable to everyone who has installed composer this software
Example
Enter Composer.json
And then
It was realized.
Installation of Redis Windows via composer