1、composer 安装一个组件(composer require topthink/think-worker) 报错如下
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubles hooting.md#degraded-mode for more info
[ErrorException]
zlib_decode(): data error
require [–dev] [–prefer-source] [–prefer-dist] [–no-progress] [–no-suggest] [–no-update] [–no-scripts] [–update-no-dev] [–update-with-dependencies] [– update-with-all-dependencies] [–ignore-platform-reqs] [–prefer-stable] [–pref er-lowest] [–sort-packages] [-o|–optimize-autoloader] [-a|–classmap-authorita tive] [–apcu-autoloader] [–] [<packages>]…
完整截图:
解决方法:
1、首先更新composer
composer self-update
2、换http源,更改配置不要使用https加密连接
composer config -g repo.packagist composer http://packagist.phpcomposer.com
composer config -g secure-http false
重新执行安装命令即可成功
转自:cnblog