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
(orphp composer.phar diagnose
).– Guilherme Nascimento
I have removed Composer and I am unable to install :\
– Wallace Maxters
Check the firewall under IPV6 and IPV4.
– Guilherme Nascimento
What do you mean firewall? spoke Greek now, kkkkkk
– Wallace Maxters
Ué kkkk, why Greek? Ubuntu has no Firewall interface in GUI?
– Guilherme Nascimento
@Guilhermenascimento never saw, kkkkkkk
– Wallace Maxters
Wallace, first of all, on another computer on the same network, you can install Composer?
– Guilherme Nascimento
I’ll check the other programmer’s laptop here, please
– Wallace Maxters
@Guilhermenascimento on the other guy’s computer here ran.
– Wallace Maxters
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.
– Guilherme Nascimento
Turn off the torrents.
– Diego Souza
@Zooboomafoo I wish it was just that, kkkkkkkk
– Wallace Maxters
This has happened to me before. But I insisted and it worked. Have you tried using the
sudo
before the command ?– Diego Souza
Or is the
max_execution_time
PHP that is just for the time of the request.– Diego Souza
You can rotate too
composer dump-autoload
– Diego Souza
@Zooboomafoo actually, the commands of
composer
work normally, except those using internet connection.– Wallace Maxters
Yes. The
composer
has a bug and sometimes has to do thedump-autoload
. But it’s nothing more than PHP code, so you might need to change themax_execution_time
ofphp.ini
.– Diego Souza
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.
– Wallace Maxters
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
@Cypherpotato tries to put Google’s DNS. Configures as
8.8.8.8
and8.8.4.4
– Wallace Maxters
@Wallacemaxters decided to set the
default_socket_timeout
of php.ini for9999
. Put0
, the timeout will be really zero and not infinite.– CypherPotato
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...
– Dalfior