Timeout when trying to use Composer

Asked

Viewed 1,459 times

2

When I’m running the remote composer ìnstall or composer update, I am receiving this message after a certain waiting time:

The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out https://packagist.org could not be Fully Loaded, package information was Loaded from the local cache and may be out of date

I already checked the connection to the internet and it’s all right (since even the question managed to post here :p).

The strange thing is that when I connect to my server on Amazon and run the same commands, installation usually occurs.

Does anyone know why Composer returns this message?

Is there any configuration I can use to solve this?

Update 1

When I turn the remote wget https://getcomposer.org/versions, I’m also having trouble with timeout.

Update 2:

I tried to remove Composer and install again. I used the command curl -sS http://getcomposer.org/installer | php

The error returned is:

The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: Connection timed out Retrying..

Update 3:

When trying to turn the command composer self-update -vvv, get the following log:

Loading config file /home/wallace/.composer/config.json
Loading config file /home/wallace/.composer/auth.json
Reading /home/wallace/.composer/composer.json
Loading config file /home/wallace/.composer/config.json
Loading config file /home/wallace/.composer/auth.json
Loading config file /home/wallace/.composer/composer.json
Loading config file /home/wallace/.composer/auth.json
Reading /home/wallace/.composer/auth.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/wallace/.composer): git branch --no-color --no-abbrev -v
Executing command (/home/wallace/.composer): git describe --exact-match --tags
Executing command (/home/wallace/.composer): git log --pretty="%H" -n1 HEAD
Reading /home/wallace/.composer/vendor/composer/installed.json
Running 1.3.1 (2017-01-07 18:08:51) with PHP 7.0.13-0ubuntu0.16.04.1 on Linux / 4.4.0-57-generic
Downloading https://getcomposer.org/versions

[Composer\Downloader\TransportException]                                     
The "https://getcomposer.org/versions" file could not be downloaded: failed  
to open stream: Connection timed out   
  • Test the command composer diagnose (or php composer.phar diagnose).

  • I have removed Composer and I am unable to install :\

  • Check the firewall under IPV6 and IPV4.

  • What do you mean firewall? spoke Greek now, kkkkkk

  • Ué kkkk, why Greek? Ubuntu has no Firewall interface in GUI?

  • @Guilhermenascimento never saw, kkkkkkk

  • Wallace, first of all, on another computer on the same network, you can install Composer?

  • I’ll check the other programmer’s laptop here, please

  • @Guilhermenascimento on the other guy’s computer here ran.

  • Blz one less problem, so it’s probably your machine, now if you can confirm the version of PHP used in CLI and if SSL certificates are ok, we can do other tests.

  • 3

    Turn off the torrents.

  • @Zooboomafoo I wish it was just that, kkkkkkkk

  • This has happened to me before. But I insisted and it worked. Have you tried using the sudo before the command ?

  • Or is the max_execution_time PHP that is just for the time of the request.

  • You can rotate too composer dump-autoload

  • @Zooboomafoo actually, the commands of composer work normally, except those using internet connection.

  • 1

    Yes. The composer has a bug and sometimes has to do the dump-autoload. But it’s nothing more than PHP code, so you might need to change the max_execution_time of php.ini.

  • I can solve the problem if I disconnect the internet and connect again. But when a while goes by, the problem appears again. Looks like it’s some real network problem.

  • 1

    I am having this problem in Windows, the difference is that it happens both in PHP and Composer. And, even disabling the Ipv6, the problem persists.

  • @Cypherpotato tries to put Google’s DNS. Configures as 8.8.8.8 and 8.8.4.4

  • @Wallacemaxters decided to set the default_socket_timeout of php.ini for 9999. Put 0, the timeout will be really zero and not infinite.

  • Greetings, your that doubt is kind of old but I was having this problem in the last weeks... It was the Ipv6, disabled and worked. I disabled the Gnome GUI and I’m using Ubuntu 20, it was a wi-fi connection. After so many attempts I got here: https://getcomposer.org/doc/articles/troubleshooting.md It wasn’t exactly as it says on the link above that I solved but gave a light...

Show 17 more comments

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.