yii2 - 1: composer 安装yii2 - 申请github账户,获取token 安装yii2
1.在使用github获取数据的时候,需要注册一个github账户
在账户 Account -->Setting 点击后页面刷新后, 点击 Personal access tokens, 点击Generate new Token按钮 生成token
2.在安装composer的路径下:
执行:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.6
当然,看版本号,目前最新是2.0.6
在执行过程中,提示:
Could not fetch https://api.github.com/repos/RobinHerbots/jquery.inputmask/commits/b8f06eef3ccf9b8009607f30d47f66133670afc2, please create a GitHub OAuth token to go over the API rate limit Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+nsyong+2015-09-06+1627 to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer. Token (hidden):
在这里通过粘贴的方式吧上面的token粘贴上去,即可下载完成,整个Log
[root@nsyong yii_framework]# curl -sS https://getcomposer.org/installer | php #!/usr/bin/env php All settings correct for using Composer Downloading... Composer successfully installed to: /www/web/yii_framework/composer.phar Use it: php composer.phar [root@nsyong yii_framework]# php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.6 Installing yiisoft/yii2-app-advanced (2.0.6) - Installing yiisoft/yii2-app-advanced (2.0.6) Downloading: 100% Created project in advanced Loading composer repositories with package information Installing dependencies (including require-dev) Reading bower.json of bower-asset/jquery.inputmask (3.1.40) Could not fetch https://api.github.com/repos/RobinHerbots/jquery.inputmask/commits/b8f06eef3ccf9b8009607f30d47f66133670afc2, please create a GitHub OAuth token to go over the API rate limit Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+nsyong+2015-09-06+1627 to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer. Token (hidden): Token stored successfully. - Installing yiisoft/yii2-composer (2.0.3) Downloading: 100% - Installing ezyang/htmlpurifier (v4.6.0) Downloading: 100% - Installing cebe/markdown (1.1.0) Downloading: 100% - Installing bower-asset/jquery (2.1.4) Downloading: 100% - Installing bower-asset/jquery.inputmask (3.1.63) Downloading: 100% - Installing bower-asset/punycode (v1.3.2) Loading from cache - Installing bower-asset/yii2-pjax (v2.0.4) Downloading: 100% - Installing yiisoft/yii2 (2.0.6) Downloading: 100% - Installing swiftmailer/swiftmailer (v5.4.1) Downloading: 100% - Installing yiisoft/yii2-swiftmailer (2.0.4) Downloading: 100% - Installing yiisoft/yii2-codeception (2.0.4) Downloading: 100% - Installing bower-asset/bootstrap (v3.3.5) Downloading: 100% - Installing yiisoft/yii2-bootstrap (2.0.4) Downloading: 100% - Installing yiisoft/yii2-debug (2.0.5) Downloading: 100% - Installing bower-asset/typeahead.js (v0.10.5) Loading from cache - Installing phpspec/php-diff (v1.0.2) Downloading: 100% - Installing yiisoft/yii2-gii (2.0.4) Downloading: 100% - Installing fzaninotto/faker (v1.5.0) Downloading: 100% - Installing yiisoft/yii2-faker (2.0.3) Downloading: 100% fzaninotto/faker suggests installing ext-intl (*) Writing lock file Generating autoload files [root@nsyong yii_framework]# ls advanced composer.phar
到这里yii2的安装全部完成。
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。