composer 安装 yii2 问题?

coachmans
  • 4.6k

我根据文档里面的安装说明可以正常安装yii2,但是默认的路径是C:/Users/User/AppData/Roaming/Composer。而我想在自定的目录下安装yii2,要怎么设置才可以!

D:\htdocs\yii2-dev>composer global require "fxp/composer-asset-plugin:^1.2.0"
Changed current directory to C:/Users/Admin/AppData/Roaming/Composer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
^C^C终止批处理操作吗(Y/N)? y

D:\htdocs\yii2-dev>php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.11
Could not open input file: composer.phar

D:\htdocs\yii2-dev>composer global create-project yiisoft/yii2-app-basic basic 2.0.11
Changed current directory to C:/Users/Admin/AppData/Roaming/Composer
^C^C终止批处理操作吗(Y/N)? Y

D:\htdocs\yii2-dev>composer update
回复
阅读 2.9k
1 个回答

C:/Users/User/AppData/Roaming/Composer是composer全局包路径
因为你的命令加了global,不加的话,默认就是当前目录。

composer global create-project yiisoft/yii2-app-basic basic 2.0.11

改成

composer create-project yiisoft/yii2-app-basic basic 2.0.11
宣传栏