1

The steps to install composer globally is there: https://getcomposer.org/doc/00-intro.md#globally

The commands there are:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

but The original the command: curl -sS https://getcomposer.org/installer | php returns: curl: (7) Failed connect to getcomposer.org:8888; Connection refused

if put :80 on url the command: curl -sS https://getcomposer.org:80/installer | php
returns: curl: (7) Failed connect to getcomposer.org:8888; Connection refused

if tell port with -P the command: curl -sS -P 80 https://getcomposer.org/installer | php
returns: curl: (7) Failed connect to getcomposer.org:8888; Connection refused

Someone here: Installing composer using vagrant, hhvm, and Ubuntu 14.04
told to try wget I tried and the results:

The command: wget https://getcomposer.org/installer
returns: --2014-08-29 19:13:24-- https://getcomposer.org/installer Connecting to 127.0.0.1:8888... failed: Connection refused.

The command: wget https://getcomposer.org:80/installer
returns: --2014-08-29 19:13:40-- https://getcomposer.org:80/installer Connecting to 127.0.0.1:8888... failed: Connection refused
.

Im installing it on a Linux Mint Debian Edition and it complain about port 8888
I can ping getcomposer.org and telnet getcomposer.org:80
Someone can see what im doing wrong?
Someone voting against this question but is unable to tell what is wrong with it

2
  • Curl should be connecting to getcomposer.org on port 443 as its a https website. What is the output of curl -v https://getcomposer.org/installer -o /dev/null ?
    – Yuvika
    Aug 30, 2014 at 11:04
  • 1
    This looks like a local proxy to me. Are there any environment variables related to "proxy" defined?
    – Sven
    Aug 30, 2014 at 18:38

2 Answers 2

5

This is not a perfect answer but it solved for me.

just hit the url

https://getcomposer.org/installer

it'll download a file name "installer", Now go to the download folder where it downloaded

Run this command

php installer

It'll give you new file composer.phar

This is the exact file that you will get from this command

curl -sS https://getcomposer.org/installer | php
1
  • Hi @gsjha I did like you mentioned, but I failed.
    – David Teo
    Nov 1 at 8:30
1

Fot some reason Curl try using ipv6 to download compose, and the result is a time out.

try this: echo ipv4 >> ~/.curlrc

then try again: curl -sS https://getcomposer.org/installer | php

1
  • ipv6 is disabled on my network - this solved my problem.
    – DanielV
    Feb 21, 2019 at 5:13

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.