Недавно я изменил свою среду разработки с Windows на Linux. Я установил сервер ламп с помощью phpmyadmin и установил 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 ответ1

0

Мне удалось решить проблему, выполнив

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

не уверен, что предыдущая ошибка связана с этим, но после того, как я сделал это, это сработало. Надеюсь, это поможет любому, у кого была похожая проблема.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .