当前位置: 首页 > 知识库问答 >
问题:

Laravel-编写器更新:连接被拒绝

沙柏
2023-03-14

在prod server上执行$composer update时,我收到以下消息:

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

一个月前它还可以正常工作。

这是我安装的软件包列表(如果有帮助的话):

arrilot/laravel-widgets               3.9.0   A powerful alternative to view composers. Asynchronous widgets, reloadable widgets, console...
balping/json-raw-encoder              v1.0.0  Encode arrays to json with raw JS objects (eg. callbacks) in them
composer/ca-bundle                    1.1.0   Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bun...composer/composer                     1.6.2   Composer helps you declare, manage and install dependencies of PHP projects, ensuring you h...
composer/semver                       1.4.2   Semver library that offers utilities, version constraint parsing and validation.composer/spdx-licenses                1.2.0   SPDX licenses list and validation library.
consoletvs/charts                     6.2.1   The laravel charting packagednoegel/php-xdg-base-dir              0.1     implementation of xdg base directory specification for php
doctrine/annotations                  v1.6.0  Docblock Annotations Parserdoctrine/cache                        v1.7.1  Caching library offering an object-oriented API for many cache backends
doctrine/collections                  v1.5.0  Collections Abstraction librarydoctrine/common                       v2.8.1  Common Library for Doctrine projects
doctrine/dbal                         v2.6.3  Database Abstraction Layerdoctrine/inflector                    v1.3.0  Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                 1.1.0   A small, lightweight utility to instantiate objects in PHP without invoking their constructorsdoctrine/lexer                        v1.0.1  Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
egulias/email-validator               2.1.3   A library for validating emails against several RFCserusev/parsedown                      1.6.4   Parser for Markdown.
fideloper/proxy                       3.3.4   Set trusted proxies for Laravelfilp/whoops                           2.1.14  php error handling for cool kids
fzaninotto/faker                      v1.7.1  Faker is a PHP library that generates fake data for you.
geoip2/geoip2                         v2.8.0  MaxMind GeoIP2 PHP API
gloudemans/shoppingcart               2.5.0   Laravel Shoppingcart
guzzlehttp/psr7                       1.4.2   PSR-7 message implementation that also provides common utility methods
hamcrest/hamcrest-php                 v2.0.0  This is the PHP port of Hamcrest Matchers
intervention/image                    2.4.1   Image handling and manipulation library with support for Laravel integration
jakub-onderka/php-console-color       0.1
jakub-onderka/php-console-highlighter v0.3.2
justinrainbow/json-schema             5.2.6   A library to validate a json schema.
larapack/doctrine-support             v0.1.4  Better Doctrine Support with Laravel (Support for `enum`)
larapack/hooks                        v1.0.1  A Laravel Hook system
larapack/voyager-hooks                v1.0.4  Hooks integrated in Voyager
laravel/framework                     v5.5.28 The Laravel Framework.
laravel/tinker                        v1.0.3  Powerful REPL for the Laravel framework.
league/flysystem                      1.0.41  Filesystem abstraction: Many filesystems, one API.
maxmind-db/reader                     v1.3.0  MaxMind DB Reader API
maxmind/web-service-common            v0.5.0  Internal MaxMind Web Service API
mockery/mockery                       1.0     Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHP...
monolog/monolog                       1.23.0  Sends your logs to files, sockets, inboxes, databases and various web services
mtdowling/cron-expression             v1.2.1  CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is...
myclabs/deep-copy                     1.7.0   Create deep copies (clones) of your objects
nesbot/carbon                         1.22.1  A simple API extension for DateTime.
nikic/php-parser                      v3.1.3  A PHP parser written in PHP
paragonie/random_compat               v2.0.11 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phar-io/manifest                      1.0.1   Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                       1.0.1   Library for handling version information and constraints
phpdocumentor/reflection-common       1.0.1   Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock     4.2.0   With this component, a library can provide support for annotations via DocBlocks or otherwi...
phpdocumentor/type-resolver           0.4.0
phpspec/prophecy                      1.7.3   Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage             5.3.0   Library that provides collection, processing, and rendering functionality for PHP code cove...
phpunit/php-file-iterator             1.4.5   FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template             1.2.1   Simple template engine.
phpunit/php-timer                     1.0.9   Utility class for timing
phpunit/php-token-stream              2.0.2   Wrapper around PHP's tokenizer extension.
phpunit/phpunit                       6.5.5   The PHP Unit Testing framework.
phpunit/phpunit-mock-objects          5.0.6   Mock Object library for PHPUnit
psr/container                         1.0.0   Common Container Interface (PHP FIG PSR-11)
psr/http-message                      1.0.1   Common interface for HTTP messages
psr/log                               1.0.2   Common interface for logging libraries
psr/simple-cache                      1.0.0   Common interfaces for simple caching
psy/psysh                             v0.8.17 An interactive shell for modern PHP.
ramsey/uuid                           3.7.1   Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 un...
sebastian/code-unit-reverse-lookup    1.0.1   Looks up which function or method a line of code belongs to
sebastian/comparator                  2.1.1   Provides the functionality to compare PHP values for equality
sebastian/diff                        2.0.1   Diff implementation
sebastian/environment                 3.1.0   Provides functionality to handle HHVM/PHP environments
sebastian/exporter                    3.1.0   Provides the functionality to export PHP variables for visualization
sebastian/global-state                2.0.0   Snapshotting of global state
sebastian/object-enumerator           3.0.3   Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector            1.1.1   Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context           3.0.0   Provides functionality to recursively process PHP variables
sebastian/resource-operations         1.0.0   Provides a list of PHP built-in functions that operate on resources
sebastian/version                     2.0.1   Library that helps with managing the version number of Git-hosted PHP projects
seld/cli-prompt                       1.0.3   Allows you to prompt for user input on the command line, and optionally hide the characters...
seld/jsonlint                         1.7.0   JSON Linter
seld/phar-utils                       1.0.1   PHAR file format utilities, for when PHP phars you up
simshaun/recurr                       v3.0.5  PHP library for working with recurrence rules
swiftmailer/swiftmailer               v6.0.2  Swiftmailer, free feature-rich PHP mailer
symfony/console                       v3.4.3  Symfony Console Component
symfony/css-selector                  v3.4.3  Symfony CssSelector Component
symfony/debug                         v3.4.3  Symfony Debug Component
symfony/event-dispatcher              v4.0.3  Symfony EventDispatcher Component

自上次以来,我添加的唯一新包是consoletvs/invoices

我尝试了作曲家自我更新,我没有任何代理或诸如此类的东西。

这是我的配置:

  • 拉威尔5.5
$ ~/composer.phar diagnose

Checking composer.json: OK
Checking platform settings: WARNING
PHP was compiled with --enable-sigchild which can cause issues on some platforms.
Recompile it without this flag if possible, see also:
  https://bugs.php.net/bug.php?id=22999

Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
WARNING
Github has a rate limit on their API. You currently have 0 out of 60 requests left.
See https://developer.github.com/v3/#rate-limiting and also
    https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.7.2
PHP version: 7.2.5
PHP binary path: /usr/local/php7.2/bin/php
$ ~/composer.phar update -vvv

Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/user/www/dev): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /homez.188/user/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /home/user/www/dev/vendor/composer/installed.json
Loading plugin Symfony\Thanks\Thanks
Running 1.7.2 (2018-08-16 16:57:12) with PHP 7.1.17 on Linux / 4.14.61-ovh-vps-grsec-zfs-classid
Loading composer repositories with package information
Downloading https://larapack.io/packages.json
Downloading https://larapack.io/packages.json
Downloading https://larapack.io/packages.json


  [Composer\Downloader\TransportException]
  The "https://larapack.io/packages.json" file could not be downloaded: failed to open stream: Conn
  ection refused


Exception trace:
 () at phar:///home/user/composer.phar/src/Composer/Util/RemoteFilesystem.php:547
 Composer\Util\RemoteFilesystem->get() at phar:///home/user/composer.phar/src/Composer/Util/RemoteFilesystem.php:101
 Composer\Util\RemoteFilesystem->getContents() at phar:///home/user/composer.phar/src/Composer/Repository/ComposerRepository.php:682
 Composer\Repository\ComposerRepository->fetchFile() at phar:///home/user/composer.phar/src/Composer/Repository/ComposerRepository.php:497
 Composer\Repository\ComposerRepository->loadRootServerFile() at phar:///home/user/composer.phar/src/Composer/Repository/ComposerRepository.php:276
 Composer\Repository\ComposerRepository->hasProviders() at phar:///home/user/composer.phar/src/Composer/DependencyResolver/Pool.php:99
 Composer\DependencyResolver\Pool->addRepository() at phar:///home/user/composer.phar/src/Composer/Installer.php:378
 Composer\Installer->doInstall() at phar:///home/user/composer.phar/src/Composer/Installer.php:228
 Composer\Installer->run() at phar:///home/user/composer.phar/src/Composer/Command/UpdateCommand.php:162
 Composer\Command\UpdateCommand->execute() at phar:///home/user/composer.phar/vendor/symfony/console/Command/Command.php:241
 Symfony\Component\Console\Command\Command->run() at phar:///home/user/composer.phar/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at phar:///home/user/composer.phar/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///home/user/composer.phar/src/Composer/Console/Application.php:254
 Composer\Console\Application->doRun() at phar:///home/user/composer.phar/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///home/user/composer.phar/src/Composer/Console/Application.php:103
 Composer\Console\Application->run() at phar:///home/user/composer.phar/bin/composer:56
 require() at /home/user/composer.phar:24

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

我刚试过$curlhttps://larapack.io/packages.json

我得到:curl:(7)未能连接到larapack.io端口443:连接拒绝

但是如果我做了curlhttps://packagist.org/packages.json,它可以工作。

请注意,这两个文件都可以通过我的浏览器访问。

这让我怀疑IPv6是否真的被禁用...

我试过几种方法,但我找不到一种合适的方法来检查它是否失效。

共有1个答案

彭修筠
2023-03-14

我通过composer安装而不是composer更新解决了这个问题。

仍然不知道为什么它不起作用,但至少它现在起作用了。。。

对于尝试(如我过去所做)在生产环境中进行composer update的人,请不要:

composer更新和composer安装之间有什么区别?

>

  • 作曲家更新主要用于开发阶段,根据我们在composer.json文件中指定的内容升级我们的项目包,

    composer安装主要用于“部署阶段”,使用由composer update创建的composer.lock文件中存储的依赖项,在生产服务器或测试环境上安装我们的应用程序。

    这里有一张很好的图表。

    关于卷曲错误的讨论发布在这里供参考:SSH卷曲在浏览器中访问URL时不起作用

    对于在OVH使用共享托管专业版SSH的法国开发人员来说,支持说像curl这样的外部调用在ssh中被禁用,但显然我可以执行curlhttps://packagist.org/packages.json。当他们尝试自己的时候,他们得到了一个错误,比如动作禁止或者类似的东西。这没有任何意义。

  •  类似资料:
    • 在我的composer.json我更新了以下行: 当我调用

    • 所以我想部署我现有的laravel porject到我的digitalOcean vps我用户这个啧啧,我上传我的网站成功 我的环境文件也是 但问题是 我使用mysql创建并运行了,得到了这些错误,问题出在哪里 [Illumb\Database\QueryException]SQLSTATE[HY000][2002]连接被拒绝(SQL:select*from information\s chema

    • 试图在localhost中建立从app容器到mysql容器的连接,出现连接拒绝异常 我们正在采取一种docker的方法来调用rest api服务来采用微服务的方法。我们正在建立应用程序容器和mysql容器之间的连接,同时我们编写了一个docker-compose文件,创建了mysql容器和应用程序容器,为这两个容器公开了端口。下面是运行docker-compose文件docker-compose

    • 我想使用Kafka发布MSSQL CDC事件。 我将Docker容器用于: null 所有容器开始成功运行。 然后我在SQL Server容器中创建了新的MSSQL数据库。在新数据库中创建了1个表,并为该表打开了CDC。疾控中心运作良好。 然后我将下面的连接器配置发送到Kafka Connect REST API,如下所示: com.microsoft.sqlserver.jdbc.sqlserv

    • 问题内容: 我是 HBase 和 Hadoop的 新手。我已经完全设置了HBase并完美启动。现在,当我尝试使用Java客户端从 p1 连接到HBase(HBase安装在 p2上 )时,它抛出了一个奇怪的异常。 问题答案: 我找到了解决方案。 通过仅从我的 主机中 删除 localhost 条目。现在我的本地主机条目就像 192.169.19.50 [这是我的hbase IP] =本地主机,而不是

    • 问题内容: 我正在尝试实现TCP连接,从服务器端一切正常,但是当我运行客户端程序(从客户端计算机)时,出现以下错误: 我尝试更改套接字号以防万一,但无济于事,有谁知道导致此错误的原因和解决方法。 服务器代码: 客户代码: 问题答案: 此异常意味着你尝试连接的IP /端口上没有侦听服务: 你试图连接到错误的IP /主机或端口。 你尚未启动服务器。 你的服务器没有监听连接。 在Windows服务器上,