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:
- The zlibc library is not installed on your system.
- There is no internet connection, or the server is operating in a closed local network.
- 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.
Related Articles
Composer error: Command "require" failed. You must be using the interactive console to authenticate
When working with composer in a Magento environment, you might encounter the following error: This error typically occurs when composer is unable to locate the PHP version with which it can work. The located version can be either not supported or not ...
Composer error: SSL certificate problem: certificate has expired
When working with composer, you might encounter SSL certificate issues, which can prevent composer from downloading packages. A typical error might look like this: curl error 60 while downloading ...
I’m trying to install the module via composer, but the package is not found. How to resolve it?
Composer is the dependency manager that allows you easily download the required files on your server. The files are located on a remote server, or a repository, that you need to add to the list of “known” ones and authenticate to using the username ...
I’ve updated the modules via composer and I got the Autoload error: Module 'Amasty_Base' has been already defined.
When installing or updating Amasty modules for Magento, there are two primary methods to choose from: using composer or direct file upload. Depending on the initial installation method, the module files will be located in a specific directory. Each ...
Composer doesn’t allow me to update the module to the latest version. Is there a solution for it?
While updating Amasty extensions via composer, you may encounter a Nothing to install, update or remove message, as if there are no updates for the modules. There are several possible reasons why the composer is not fetching the latest version of the ...