Composer Error while installing Laravel "Failed to decode response: zlib_decode(): data error"

Try the following command:

composer clear-cache

Add this lines to " composer.json " before the last line that conten this symbol " } "

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

Now cd to your project folder and type :

Composer install

Credits to: http://www.webdeveloper.com/forum/showthread.php?285403-Need-Help-Installing-Laravel


Short: Run composer self-update --update-keys and follow instructions.


Step by step:

I had the same error when trying to install dependencies for my project:

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
Your configuration does not allow connection to http://packagist.org. See https://getcomposer.org/doc/06-config.md#secure-http for details.
http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

Just to be sure, I tried to update the composer with composer self-update, which gave me the same error, but another hint:

[RuntimeException]
The phar signature did not match the file you downloaded, this means your public keys are outdated or that the phar file is corrupt/has been modified

The issues is solved by running

composer self-update --update-keys

and entering the keys from Composer Public Keys / Signatures page. I was able to download my dependencies afterwards.