环境windows7,首先按安装composer这里就不多说了,然后cmd进入项目目录
prefer-dist参数前面是两个半角英文-
redis执行:
composer require –prefer-dist yiisoft/yii2-redis “^2.0”
或
php composer.phar –prefer-dist yiisoft/yii2-redis “^2.0”
mongodb执行:
composer require –prefer-dist yiisoft/yii2-mongodb “^2.0”
或
php composer.phar –prefer-dist yiisoft/yii2-mongodb “^2.0”
mongodb 2.1需要php7才支持
执行完成后它会改写composer.json文件和在\vendor\yiisoft下有对应的目录生成