We've shared a lot of examples of redis extensions, and this article goes on to share with you the yii2.0 framework to install the Redis extension in the hope that it will help everyone.
1. Install through composer, run to the project root directory cmd (recommended)
PHP Composer.phar require--prefer-dist Yiisoft/yii2-redis
or add
"Yiisoft/yii2-redis": "~2.0.0" to the Composer.json file of the corresponding project,
Run Composer Update again
2. Manual Installation
Click to download: Yii2.0-redis extension
Put the downloaded extension file under vendor/yiisoft/, named Yii2-redis
Modify extensions.php under vendor/yiisoft/to join the Redis extension
' Yiisoft/yii2-redis ' = = Array ( ' name ' = ' = ' Yiisoft/yii2-redis ', ' version ' = ' 2.2.0.0 ', ' Alias ' = ' = Array ( ' @yii/redis ' = $vendorDir. '/yiisoft/yii2-redis ', ), ),
Description
Using composer require--prefer-dist Yiisoft/yii2-redis
This command first checks the version of the Redis extension that can be used, forcing the dist to be a compressed package.
Modify the local Conposer.json file.
Download the dependent Redis extensions and install them.
Write the lock file to generate the AutoLoad file.
Related recommendations:
Example of installing Redis extensions in PHP under Windows
How to install Redis extensions for the PHP under win
PHP redis extension from installation to use