Composer error: Failed to decode response: Failed to decode zlib stream

Composer error: Failed to decode response: Failed to decode zlib stream

When using composer to download packages, you might encounter an error related to zlib library. A typical error looks like this:



This error can occur due to several reasons including:
  1. The zlibc library is not installed on your system.
  2. There is no internet connection, or the server is operating in a closed local network.
  3. The zlib.output_compression option in PHP settings is disabled.
If you've experienced this error using Composer, there are several ways on how to solve this:

1. Ensure that the Amasty repository is installed and that your authentication keys are valid. Refer to our Composer User Guide for more information.

2. Check whether the server have access to the internet. The below command can help with it: 

curl -I https://amasty.com


3. Check whether the required zlibc library is installed on the server. The next command will either install it or will show that this library is already installed: 

sudo apt-get install zlibc


4. Check whether the zlib.output_compression setting is enabled in the php.ini file. It can be checked with this command: 

php -i | grep "zlib.output_compression"



In case the issue persists, please contact our support team.