1. 使用composer install/update的时候会报错:
your configuration does not allow connections to http://packagist.org/packages.json. See https://getcomposer.org/doc/06-config.md#secure-http for details.
解决方法:
composer默认使用https连接,因此无法使用http连接,只需要在本地的composer.json或者全局的config.json中把默认的https禁用即可。
//全局配置修改
composer config -g secure-http false
//本地配置修改
composer config secure-http false
2.
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
这是因为我们开启了xdebug扩展,使用该扩展的情况下,composer会变得异常耗时,这个本不是什么大问题,如果介意,可以修改/etc/php.ini或者/etc/php.d/xdebug.ini,将xdebug扩展关闭即可,别忘了重启php
3.
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
这是因为composer很久没有使用或者版本过低,需要更新一下自己本身的版本即可。
composer self-update
4 运行 composer self-update 时报错:
The "https://getcomposer.org/download/1.4.1/composer.phar" file could not be downloaded: Failed to enable crypto failed to open stream: operation failed
清空一下缓存(composer clear-cache)后再运行composer self-update。
5
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
待解决
6
Could not fetch https://api.github.com/repos/jquery/jquery-dist/commits/1472290917f17af05e98007136096784f9051fab, 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+localhost.localdomain+2017-04-23+1954
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
Token (hidden):
这是因为composer的真正资源保存在github上,因此对调用次数有一定限制,我们只需要登陆我们的github账号,然后点击我们的头像,选择 setting --> Personal access tokens 然后生成一个token即可,然后把生成的token填进去即可。
7
Do not run Composer as root/super user! See https://getcomposer.org/root for details
这是因为我们使用了超级管理员来操作composer,只需要换个普通用户即可