通过 composer 安装 yii2 并不断提示输入密码

Installing yii2 via composer and it keeps prompting for a password

我只是按照 yii 网站的说明操作,并不真正了解作曲家。我按照这里的说明进行操作 http://www.yiiframework.com/doc-2.0/guide-start-installation.html

身份验证似乎有效,但它会一次又一次地提示我输入 username/password。

有人知道我可以检查它为什么一直提示的原因吗?

[root@dndbox html]# composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
Installing yiisoft/yii2-app-basic (dev-master b528289495bf9721d2b8c628d69caad42e45b0ce)
  - Installing yiisoft/yii2-app-basic (dev-master master)
    Downloading: connection...
Could not fetch https://api.github.com/repos/yiisoft/yii2-app-basic/zipball/b528289495bf9721d2b8c628d69caad42e45b0ce, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: *.com
Password: 
An existing OAuth token for Composer is present and will be reused

Could not fetch https://api.github.com/authorizations, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: *.com
Password: 
An existing OAuth token for Composer is present and will be reused

Could not fetch https://api.github.com/authorizations, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: 

==================================== 编辑 1 ======= ==============================

如果我访问 URL,前提是我在 json 中收到一条错误消息,https://api.github.com/authorizations

{
  "message": "API rate limit exceeded for xxx.xxx.xxx.26. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://developer.github.com/v3/#rate-limiting"
}

在论坛上看到这个答案

http://www.yiiframework.com/forum/index.php/topic/60340-issue-while-installing-yii-2/page__view__findpost__p__269389

它帮助了我

  1. 创建一个 Github 帐户。
  2. 转到https://github.com/s...gs/applications并删除您之前在安装yii2时生成的令牌
  3. 创建一个新令牌。
  4. 运行 这个:composer config -g github-oauth.github.com
  5. 使用 yii2 安装重试

它可能对您有更多帮助。按照以下步骤操作:

  1. Create/Sign 进入 github 帐户。
  2. 转到个人资料>>设置>>个人访问令牌(或)单击此https://github.com/settings/tokens
  3. 点击生成新令牌
  4. Select 适当的范围并单击 生成令牌
  5. 复制令牌密钥并在作曲家想要您令牌时将其传递给作曲家(例如:令牌(隐藏):)

现在将进入安装过程

祝你好运...