composer报错:Content-Length mismatch, received xxx bytes out of ....问题解决

composer是一款非常好的依赖管理工具,但是偶尔会让开发者烦躁!

今天系统引入七牛的sdk在tp框架中,用composer安装的时候发现报错了,搜索网上的基本都是让你设置地址为国内的(其实没luan用,本来就是设置了的),然鹅

真正能解决的是什么呢?

问题描述:

D:\tools\www\thinkphp5\selfWeixin>composer require qiniu/php-sdk
Using version ^7.2 for qiniu/php-sdk
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)  
Content-Length mismatch, received 65273 bytes out of the expected 146671
https://packagist.phpcomposer.com could not be fully loaded, package information was loaded from the local cache and may be out of date



接下来修改缓存的大小,修改300M为1024M试试(先用composer config -gl查看配置):



重新执行SDK的安装,发现安装就成功了:

D:\tools\www\thinkphp5\selfWeixin>composer require qiniu/php-sdk
Using version ^7.2 for qiniu/php-sdk
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing qiniu/php-sdk (v7.2.10): Loading from cache
Writing lock file
Generating autoload files

评论/留言