【问题标题】:Composer update does not runComposer 更新不运行
【发布时间】:2017-06-22 17:33:48
【问题描述】:

当我运行作曲家更新它失败显示错误:

[Composer\Downloader\TransportException]                                                                           
The "https://packagist.org/packages.json" file could not be     downloaded: failed to open stream: 

连接被拒绝

如果我从浏览器访问 URL,当我尝试 wgetcurl 从终端访问 URL 时,它会显示错误:

--2017-02-05 20:41:58--  https://packagist.org/packages.json
Connecting to 127.0.0.1:8888... failed: 
Connection refused.

--2017-02-05 20:41:58--  https://packagist.org/packages.json
Connecting to 127.0.0.1:8888... failed: Connection refused.

我认为它与代理连接有关,但我似乎无法解决问题。

如果我运行 composer update -vv,下面是完整的跟踪:

Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/gidiscrap): git branch --no-color --no-                     abbrev -v
Cannot create cache directory      /home/oluwaslim/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/oluwaslim/.composer/cache/files/, or directory is not writable. Proceeding without cache
Failed to initialize global composer: Composer could not find the config file: /home/oluwaslim/.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/gidiscrap/vendor/composer/installed.json
Running 1.3.2 (2017-01-27 18:23:41) with PHP 7.0.13-0ubuntu0.16.04.1 on Linux / 4.4.0-59-generic
Loading composer repositories with package information
   Downloading https://packagist.org/packages.json using proxy 127.0.0.1:8888
   Downloading https://packagist.org/packages.json using proxy 127.0.0.1:8888
   Downloading https://packagist.org/packages.json using proxy 127.0.0.1:8888


  [Composer\Downloader\TransportException]                                                                           
  The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection refused  


Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:489
 Composer\Util\RemoteFilesystem->get() at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:101
 Composer\Util\RemoteFilesystem->getContents() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:665
 Composer\Repository\ComposerRepository->fetchFile() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:479
 Composer\Repository\ComposerRepository->loadRootServerFile() at phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:258
 Composer\Repository\ComposerRepository->hasProviders() at phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Pool.php:99
 Composer\DependencyResolver\Pool->addRepository() at phar:///usr/local/bin/composer/src/Composer/Installer.php:376
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:223
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:158
 Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:850
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:227
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:124
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:100
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:54
 require() at /usr/local/bin/composer:24

我们将不胜感激!我似乎无法克服这个错误

【问题讨论】:

    标签: linux laravel proxy composer-php


    【解决方案1】:

    我在 Ubuntu Linux 16.04 上,下面是我必须解决的问题,正如我之前提到的它与代理设置有关的一些问题。

    第一步

    • 转到系统设置
    • 网络
    • 网络代理
    • 将其更改为无
    • 最后点击应用系统范围

    第 2 步

    • 打开终端并输入以下命令。
      unset https_proxy && unset socks_proxy && unset ftp_proxy

    最后重新启动您的系统。上面的解决方案为我解决了问题。

    【讨论】:

      【解决方案2】:

      using proxy 127.0.0.1:8888 行表明您的系统存在问题。我可以猜到这是一个非常激进的杀毒软件。除非您必须通过代理连接,否则您应该没有理由在端口 8888 上连接到 localhost。你能做什么?检查防病毒设置并关闭对通过 HTTPS 的安全连接的检查。

      【讨论】:

      • 我没有安装任何防病毒软件。我安装了 Linux 16.04
      • 您使用某种代理吗? Tor 也许?
      • 不!我不记得安装任何
      • 请检查您的主目录中是否存在~/.wgetrc 并检查其中的代理设置。
      • 没有这样的文件或目录!!我知道这是我系统的问题
      猜你喜欢
      • 1970-01-01
      • 2020-04-10
      • 2013-12-22
      • 2017-04-25
      • 2020-09-03
      • 2014-11-11
      • 2013-10-23
      • 2014-10-08
      • 2014-09-09
      相关资源
      最近更新 更多