composer 安装
- 进入var/src目录中
- 下载composer安装包
curl -sS https://getcomposer.org/installer | php
- 设置全局访问
sudo mv composer.phar /usr/local/bin/composer
- 安装插件
composer global require "fxp/composer-asset-plugin:~1.1.1"
- composer安装完成,(以yii2为例,下载)
composer create-project --prefer-dist yiisoft/yii2-app-basic
- ps:第一次用composer下载时,终端有可能会显示:Updating dependencies (including require-dev),而且时间较久,此时在更新依赖。
- 之后会提示要求输入token,这个token是在GitHub中生成;
https://github.com/settings/tokens
点击点击右上角Generate new token,输入相应描述,然后点击下边生成按钮即可