composer update Failed to decode response: zlib_decode(): data error

0

recently I changed my development environment from windows to linux. I setup a lamp server with phpmyadmin and installed composer using sudo apt-get install composer

Then I tried sudo composer update -vvv from within my project and got the following output

Reading ./composer.json
Loading config file ./composer.json
Checking CA file /etc/ssl/certs/ca-certificates.crt
Executing command (/var/www/mysite): git branch --no-color --no-abbrev -v
Executing command (/var/www/mysite): git describe --exact-match --tags
Failed to initialize global composer: Composer could not find the config file: /home/me/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/mysite/vendor/composer/installed.json
Loading plugin yii\composer\Plugin
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/me/.composer/cache/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/me/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/me/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Downloading http://packagist.org/p/provider-2015%245eb5546eae20b24d9d7952a55183a90ee45ca1a1be5c5061e9c36c5cb7c55396.json

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
Downloading http://packagist.org/p/provider-2015%245eb5546eae20b24d9d7952a55183a90ee45ca1a1be5c5061e9c36c5cb7c55396.json
Downloading http://packagist.org/p/provider-2015%245eb5546eae20b24d9d7952a55183a90ee45ca1a1be5c5061e9c36c5cb7c55396.json
Downloading http://packagist.org/p/provider-2015%245eb5546eae20b24d9d7952a55183a90ee45ca1a1be5c5061e9c36c5cb7c55396.json
Reading /home/me/.composer/cache/repo/https---packagist.org/p-provider-2015.json from cache

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
Reading /home/me/.composer/cache/repo/https---packagist.org/p-provider-2016.json from cache
Reading /home/me/.composer/cache/repo/https---packagist.org/p-provider-2017-01.json from cache
Reading /home/me/.composer/cache/repo/https---packagist.org/p-provider-2017-04.json from cache
Downloading http://packagist.org/p/provider-2017-07%24f8660d0af3680014c46ac2b77b594798f0902078e12d015457257c79beb4390a.json
Downloading http://packagist.org/p/provider-2017-07%24f8660d0af3680014c46ac2b77b594798f0902078e12d015457257c79beb4390a.json
Downloading http://packagist.org/p/provider-2017-07%24f8660d0af3680014c46ac2b77b594798f0902078e12d015457257c79beb4390a.json


      [Composer\Downloader\TransportException]                                                                                                     
      Your configuration does not allow connection to http://packagist.org. See https://getcomposer.org/doc/06-config.md#secure-http for details.  


    Exception trace:
     () at /usr/share/php/Composer/Util/RemoteFilesystem.php:271
     Composer\Util\RemoteFilesystem->get() at /usr/share/php/Composer/Util/RemoteFilesystem.php:99
     Composer\Util\RemoteFilesystem->getContents() at /usr/share/php/Composer/Repository/ComposerRepository.php:628
     Composer\Repository\ComposerRepository->fetchFile() at /usr/share/php/Composer/Repository/ComposerRepository.php:541
     Composer\Repository\ComposerRepository->loadProviderListings() at /usr/share/php/Composer/Repository/ComposerRepository.php:283
     Composer\Repository\ComposerRepository->whatProvides() at /usr/share/php/Composer/DependencyResolver/Pool.php:199
     Composer\DependencyResolver\Pool->computeWhatProvides() at /usr/share/php/Composer/DependencyResolver/Pool.php:188
     Composer\DependencyResolver\Pool->whatProvides() at /usr/share/php/Composer/Installer.php:842
     Composer\Installer->processDevPackages() at /usr/share/php/Composer/Installer.php:492
     Composer\Installer->doInstall() at /usr/share/php/Composer/Installer.php:228
     Composer\Installer->run() at /usr/share/php/Composer/Command/UpdateCommand.php:173
     Composer\Command\UpdateCommand->execute() at /usr/share/php/Symfony/Component/Console/Command/Command.php:256
     Symfony\Component\Console\Command\Command->run() at /usr/share/php/Symfony/Component/Console/Application.php:841
     Symfony\Component\Console\Application->doRunCommand() at /usr/share/php/Symfony/Component/Console/Application.php:189
     Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:166
     Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:120
     Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:99
     Composer\Console\Application->run() at /usr/bin/composer:44

    update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

would greatly appreciate any advice, thanks

natral

Posted 2017-10-18T19:12:55.210

Reputation: 163

Answers

0

I managed to solve the problem by doing

composer global require "fxp/composer-asset-plugin:~1.1.1"

not sure what the previous error has to do with this but after I did this it worked. Hope this helps anyone who has had a similar problem.

natral

Posted 2017-10-18T19:12:55.210

Reputation: 163