更新: 我刚刚在评论中建议将此问题发布到bug跟踪器,现在我运行了新版本作曲家的干净安装(作曲家版本7131607ad1d251c790ce566119d647e008972aa5 2014-05-27 14:26:24)并且问题已修复。
原始邮寄: 我试图在http://docs.doctrine-project.org/en/latest/tutorials/getting-started.html
使用他们的教程学习如何使用doctrine2但由于某种原因,我在尝试运行composer install
时遇到此错误:
[ErrorException]
zlib_decode(): data error
这是composer.json的内容:
{
"require": {
"doctrine/orm": "2.4.*",
"symfony/yaml": "2.*"
},
"autoload": {
"psr-0": {"": "src/"}
}
}
编辑:PHP版本5.5.9。
编辑: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]
答案 0 :(得分:1)
在最后一天,我花费了大量时间来处理zlib_decode(): data error
问题,这肯定与您尝试安装的确切软件包无关。它必须与代理和/或糟糕的互联网连接做一些事情。禁用防病毒对我的情况没有帮助,因为我没有在我的Mac上使用防病毒软件。这些是最终有所帮助的事情。
<强> 1。通过将此添加到composer.json
。
{
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{"packagist": false}
],
"require": { /* your packages as usual */ }
}
<强> 2。如果您仍遇到此问题,请尝试运行composer diag
。在我的情况下,有一些消息是:
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
在执行composer self-update --update-keys
并按照说明进行下一次尝试后,一切正常。
答案 1 :(得分:0)
就我而言,它是Avast防病毒软件。禁用所有更新后没有问题。
答案 2 :(得分:0)
如果您使用的是debian / ubuntu,只需在您的计算机上安装解压缩:
sudo apt-get install unzip
这对我有用!