How do I install Composer without cURL command line?

16,206

Solution 1

The download page of the composer site has instructions for those missing curl that only require php:

php -r "readfile('https://getcomposer.org/installer');" | php

The above is the recommended way, but alternatively if you don't want to run the installer and all the config checks it does, you can just download the phar file from https://getcomposer.org/composer.phar - either using your browser or via wget https://getcomposer.org/composer.phar (if you have access to wget).

Solution 2

Install the composer.phar file locally and then just upload it to your hosting provider.

Alternatively, you can download composer.phar from their website.

However, it's unlikely that you'll be able to run it. Unless you are using it programatically, I recommend you install all of your dependencies locally into a release branch/package and upload that to your hosting provider.

Share:
16,206
Vikram
Author by

Vikram

Hello, I'm a computer science engineering student from India. Got to say I am simply overwhelmed by the amount of support and the quality of the answers I get for my questions here. Truly amazing community.

Updated on June 13, 2022

Comments

  • Vikram
    Vikram almost 2 years

    I need to install Composer on a shared hosting service. This service supports cURL, but does not support SSH access. As a result, I cannot run cURL commands from the command line.

    Is it possible to install cURL without a command line? Perhaps a PHP script that I run only once?

  • Vikram
    Vikram about 10 years
    I'm super new to PHP and everything, so I'm not sure I understand your post. If I understood correctly, what you are saying is that instead of simply transferring the composer.phar to the remote server, I should actually install the composer.phar on my local WAMP server using the command line. And then I have to transfer it to the remote server. Am I right?
  • Mahomedalid
    Mahomedalid about 9 years
    Almost. Composer is a tool/helper to install other extensions, modules, etc. He said you can install composer locally, install what you need about composer locally, and at the end upload all the bundle to the webserver.
  • Hayden
    Hayden over 7 years
    What happened to the curl instructions for downloading Composer? curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer