作曲家更新解码响应失败:zlib_decode():数据错误

作曲家更新解码响应失败:zlib_decode():数据错误

最近我将开发环境从 Windows 改为 Linux。我使用 phpmyadmin 设置了一个 lamp 服务器,并使用以下方式安装了 composer:sudo apt-get install composer

然后我在我的项目中尝试sudo composer update -vvv 并得到以下输出

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>]...

非常感谢您的建议,谢谢

答案1

我设法通过以下方式解决了这个问题

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

不确定之前的错误与此有什么关系,但我这样做之后就解决了。希望这对遇到类似问题的人有所帮助。

相关内容