Composer Failed to decode response: zlib_decode()

Viewed 6922

I'm trying to install crudkit.com. This is my composer.json:

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

}

After that, I run the composer using:

$ sudo php composer.phar install

But I got error like this:

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

Anyone know how to solve it?

UPDATE: I have try to composer diagnose, and I got this:

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 Answers

try to update composer as follow.

sudo composer clear-cache

add this line to composer.json

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

and then

sudo composer update

Writing the given lines in your composer.json files Hope it helps someone as it does to me. Then run composer update "repositories": [ { "type": "composer", "url": "https://packagist.org" }, { "packagist": false } ]

Related