Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install PHP Composer on Managed Hosting at Domainfactory.

Install Composer on Managed Hosting at Domainfactory

Step 1:

Log in to your Managed Hosting Server via SSH. Create your .bashrc:

touch .bashrc

Step 2:

Add these two lines to the .bashrc:

alias php7cli='/usr/local/bin/php7-71LATEST-CLI'
alias composer='php7cli ~/composer.phar'

Step 3:

Reload .bashrc with

$ source .bashrc

Step 4:

Install Composer with

$ curl -sS | php7cli

Step 5:


Check the installation with

$ composer --version

You should see something like this:

Composer version 1.7.3 2018-11-01 10:05:06

Your version will probably differ.

Copy link

trebaxa commented Sep 17, 2019

php7cli composer.phar install

Copy link

hofmannsven commented Feb 17, 2020

@trebaxa Thanks for your contribution! 👍

Copy link

trebaxa commented Mar 9, 2021

By following you get latest 1.x version
curl -sS | php7cli -- --1

And for 2.x you either skip version or pass --2
curl -sS | php7cli -- --2

Copy link

trebaxa commented Oct 30, 2021

for production use:
php7cli composer.phar install --no-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment