通常來說,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值爲你新增的)
這樣就解決掉問題了,哈哈 !