Zlib_decode (): data error using composer in doctrine2 tutorial

UPDATE: I posted this problem to the error tracker some time ago, as suggested in the comments, and now I have cleaned the new version of the composer (Composer version 7131607ad1d251c790ce566119d647e008972aa5 2014-05-27 14:26:24) and the problem has been fixed.

ORIGINAL MAIL: I'm trying to learn how to use doctrine2 using their tutorial at http://docs.doctrine-project.org/en/latest/tutorials/getting-started.html

but for some reason I get this error when trying to run composer install :

  [ErrorException] zlib_decode(): data error 

Here is the content of composer.json:

 { "require": { "doctrine/orm": "2.4.*", "symfony/yaml": "2.*" }, "autoload": { "psr-0": {"": "src/"} } } 

EDIT: PHP Version 5.5.9.

EDIT: output of composer install -vvv :

 Reading ./composer.json Executing command (CWD): git describe --exact-match --tags Executing command (CWD): git branch --no-color --no-abbrev -v Executing command (CWD): hg branch Executing command (CWD): svn info --xml Loading composer repositories with package information Downloading https://packagist.org/packages.json Writing C:/Users/User/AppData/Local/Composer/repo/https---packagist.org/packages.json into cache Installing dependencies (including require-dev) Downloading https://packagist.org/p/provider-active$1874cad4a77f2dbd91c33e813330434e6c38cd940846c58a610595dac158d161.json Writing C:/Users/User/AppData/Local/Composer/repo/https---packagist.org/p-provider-active.json into cache Downloading https://packagist.org/p/provider-archived$02a49245f4912f279bea7cd3a287cb32b6ab02623037965e5f9665bf27fe3ec9.json Downloading https://packagist.org/p/provider-archived$02a49245f4912f279bea7cd3a287cb32b6ab02623037965e5f9665bf27fe3ec9.json Downloading https://packagist.org/p/provider-archived$02a49245f4912f279bea7cd3a287cb32b6ab02623037965e5f9665bf27fe3ec9.json [ErrorException] zlib_decode(): data error Exception trace: () at phar://C:/composer/composer/src/Composer/Util/RemoteFilesystem.php:217 Composer\Util\ErrorHandler::handle() at n/a:n/a zlib_decode() at phar://C:/composer/composer/src/Composer/Util/RemoteFilesystem .php:217 Composer\Util\RemoteFilesystem->get() at phar://C:/composer/composer/src/Compos er/Util/RemoteFilesystem.php:82 Composer\Util\RemoteFilesystem->getContents() at phar://C:/composer/composer/sr c/Composer/Repository/ComposerRepository.php:612 Composer\Repository\ComposerRepository->fetchFile() at phar://C:/composer/compo ser/src/Composer/Repository/ComposerRepository.php:519 Composer\Repository\ComposerRepository->loadProviderListings() at phar://C:/com poser/composer/src/Composer/Repository/ComposerRepository.php:271 Composer\Repository\ComposerRepository->whatProvides() at phar://C:/composer/co mposer/src/Composer/DependencyResolver/Pool.php:254 Composer\DependencyResolver\Pool->computeWhatProvides() at phar://C:/composer/c omposer/src/Composer/DependencyResolver/Pool.php:243 Composer\DependencyResolver\Pool->whatProvides() at phar://C:/composer/composer /src/Composer/DependencyResolver/Solver.php:149 Composer\DependencyResolver\Solver->setupInstalledMap() at phar://C:/composer/c omposer/src/Composer/DependencyResolver/Solver.php:163 Composer\DependencyResolver\Solver->solve() at phar://C:/composer/composer/src/ Composer/Installer.php:467 Composer\Installer->doInstall() at phar://C:/composer/composer/src/Composer/Ins taller.php:215 Composer\Installer->run() at phar://C:/composer/composer/src/Composer/Command/I nstallCommand.php:122 Composer\Command\InstallCommand->execute() at phar://C:/composer/composer/vendo r/symfony/console/Symfony/Component/Console/Command/Command.php:241 Symfony\Component\Console\Command\Command->run() at phar://C:/composer/composer /vendor/symfony/console/Symfony/Component/Console/Application.php:892 Symfony\Component\Console\Application->doRunCommand() at phar://C:/composer/com poser/vendor/symfony/console/Symfony/Component/Console/Application.php:191 Symfony\Component\Console\Application->doRun() at phar://C:/composer/composer/s rc/Composer/Console/Application.php:117 Composer\Console\Application->doRun() at phar://C:/composer/composer/vendor/sym fony/console/Symfony/Component/Console/Application.php:121 Symfony\Component\Console\Application->run() at phar://C:/composer/composer/src /Composer/Console/Application.php:83 Composer\Console\Application->run() at phar://C:/composer/composer/bin/composer :43 require() at C:\composer\composer:15 install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-p lugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--ver bose] [-o|--optimize-autoloader] [packages1] ... [packagesN] 
+6
source share
3 answers

Over the last day, I spent a lot of time solving the zlib_decode(): data error problem, and this is definitely not related to which package you are trying to install. It must do something with a proxy server and / or with a poor internet connection. Disabling antivirus did not help my case, since I do not use antivirus on my Mac. This is what helped in the end.

1. Force HTTPS to search for packages by adding this to your composer.json .

 { "repositories": [ { "type": "composer", "url": "https://packagist.org" }, {"packagist": false} ], "require": { /* your packages as usual */ } } 

2. If the problem still occurs, try running composer diag . In my case, several posts were:

 Checking pubkeys: FAIL Missing pubkey for tags verification Missing pubkey for dev verification Run composer self-update --update-keys to set them up 

After running composer self-update --update-keys and following the instructions, the next time everything worked fine.

+1
source

In my case, it was an Avast antivirus. After disabling all updates without problems.

0
source

Just install unzip on your computer if you are using debian / ubuntu:

 sudo apt-get install unzip 

It works for me!

0
source

Source: https://habr.com/ru/post/969454/


All Articles