通常来说,Composer的在Windows下的安装非常简单,如下几步即可完成!cmd下运行命令:

    方案一:curl -s http://getcomposer.org/installer | php , 如果你的curl不能用,也可以使用一下的方案。

    方案二:直接下载软件来安装 https://getcomposer.org/Composer-Setup.exe


    然后是更新问题:只需要在cmd下再运行如下命令:

    php composer.phar self-update


    然后你可能在更新或者是执行composer过程中遇到下面的问题

    1.Could not fetch https://api.github.com/repos/jquery/jquery, enter your GitHub cr
edentials to go over the API rate limit
    The credentials will be swapped for an OAuth token stored in C:/Users/idiot/AppD
ata/Roaming/Composer/auth.json, your password will not be stored
    To revoke access to this token you can visit https://github.com/settings/applica
tions
    Username: 

    2.Your github oauth token for github.com contains invalid characters: ""


    这里的错误是因为你的github的token值无效或者失效,需要你新增一个token。


    解决方案

    1.首先你要更新到最新版本:php composer.phar self-update

    2.登录到Github https://github.com/settings/applications “generated a token”增加一个新的Token

    3.运行cmd  php composer.phar config -g github-oauth.github.com token (token值为你新增的)


    这样就解决掉问题了,哈哈 !