Composer无法解码响应:zlib_decode()

时间:2016-03-11 09:30:06

标签: php

我正在尝试安装crudkit.com。这是我的composer.json:

{
    "description" : "The CodeIgniter framework",
    "name" : "codeigniter/framework",
    "license": "MIT",
    "require": {
        "php": ">=5.2.4"
    },
    "require-dev": {
        "mikey179/vfsStream": "1.1.*"
    }

}

之后,我使用:

运行作曲家
$ sudo php composer.phar install

但是我得到了这样的错误:

Installing dependencies (including require-dev)
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

任何人都知道如何解决它?感谢先进的stackoverflow!

更新: 我尝试过作曲家诊断,我得到了这样的结果:

Checking composer.json: FAIL
The version field is present, it is recommended to leave it out if the package is published on Packagist.
Checking platform settings: FAIL
The OpenSSL library (0.9.8zc) used by PHP does not support TLSv1.2 or TLSv1.1.
If possible you should upgrade OpenSSL to version 1.0.1 or above.

2 个答案:

答案 0 :(得分:0)

尝试更新作曲家,如下所示。

  

sudo composer clear-cache

将此行添加到composer.json

"repositories": [
    {
        "type": "composer",
        "url": "https://packagist.org"
    },
    { "packagist": false }
],

然后

  

sudo composer update

答案 1 :(得分:0)

在composer.json文件中写入给定的行希望它能像我一样对某人有所帮助。 然后运行作曲家更新     “存储库”:[             {                 “ type”:“ composer”,                 “ url”:“ https://packagist.org”             },             {“ packagist”:假}         ]