Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Composer on Webfaction
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@luismec90

This comment has been minimized.

Copy link

@luismec90 luismec90 commented Aug 26, 2014

It works! thanks a lot!

@sebacruz

This comment has been minimized.

Copy link

@sebacruz sebacruz commented Sep 11, 2014

Thanks man!

@mnpenner

This comment has been minimized.

Copy link

@mnpenner mnpenner commented Sep 21, 2014

Awesome! Thank you!

@trevorwestca

This comment has been minimized.

Copy link

@trevorwestca trevorwestca commented Oct 30, 2014

I have returned to this thread twice now for different webfaction accounts. Thanks for doing this.

@richpolis

This comment has been minimized.

Copy link

@richpolis richpolis commented Nov 21, 2014

Thank you!

@cesars1687

This comment has been minimized.

Copy link

@cesars1687 cesars1687 commented Dec 1, 2014

Gracias (Y)

@vivianspencer

This comment has been minimized.

Copy link

@vivianspencer vivianspencer commented Feb 26, 2015

awesome

@dxii

This comment has been minimized.

Copy link

@dxii dxii commented Aug 11, 2015

Works perfect.

@ngstigator

This comment has been minimized.

Copy link

@ngstigator ngstigator commented Aug 21, 2015

starred. thanks!

@PaulKish

This comment has been minimized.

Copy link

@PaulKish PaulKish commented Aug 31, 2015

Thanks

@arandilopez

This comment has been minimized.

Copy link

@arandilopez arandilopez commented Sep 18, 2015

awesome!!! thank you!!! 👍

@johnnycho

This comment has been minimized.

Copy link

@johnnycho johnnycho commented Nov 8, 2015

THANK YOU! This was so helpful!

@lorenzschmid

This comment has been minimized.

Copy link

@lorenzschmid lorenzschmid commented Jan 1, 2016

Thanks a lot!

@zorobabel

This comment has been minimized.

Copy link

@zorobabel zorobabel commented Mar 10, 2016

This script is very useful, it worked not only for webfaction. Thanks!

@aricore

This comment has been minimized.

Copy link

@aricore aricore commented Jul 27, 2016

Thank you!!!

@graphikjunkie

This comment has been minimized.

Copy link

@graphikjunkie graphikjunkie commented Feb 18, 2017

Couldn't find this anywhere in the webfaction documentation. Thanks!

@dhigby

This comment has been minimized.

Copy link

@dhigby dhigby commented Feb 19, 2017

Thanks so much!!!
I replaced all php references with php70 and it worked great!

@rameyrobo

This comment has been minimized.

Copy link

@rameyrobo rameyrobo commented Feb 20, 2017

@dhigby

Thank you for that comment. I was racking my brain trying to get some php7 dependencies to work. I can verify that replacing instances of php54 with php70 did work.

@pjrobertson

This comment has been minimized.

Copy link

@pjrobertson pjrobertson commented Jun 26, 2017

A few small updates:

cd $HOME
ln -s `which php56` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php56
echo -e "\n# Composer\nalias composer=\"php56 \$HOME/bin/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@josuevalrob

This comment has been minimized.

Copy link

@josuevalrob josuevalrob commented Oct 18, 2018

A few small updates:

cd $HOME
ln -s `which php72` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php72
echo -e "\n# Composer\nalias composer=\"php72 \$HOME/bin/composer.phar\"" >> 
$HOME/.bash_profile
source $HOME/.bash_profile
@riverofjanuary

This comment has been minimized.

Copy link

@riverofjanuary riverofjanuary commented Dec 23, 2018

A few small updates:

cd $HOME
ln -s `which php72` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php72
echo -e "\n# Composer\nalias composer=\"php72 \$HOME/bin/composer.phar\"" >> 
$HOME/.bash_profile
source $HOME/.bash_profile

Using this I got:

echo -e "\n# Composer\nalias composer=\"php72 \$HOME/bin/composer.phar\"" >>

-bash: syntax error near unexpected token newline'`

@danielfowler

This comment has been minimized.

Copy link

@danielfowler danielfowler commented Aug 15, 2019

Updated for PHP 7.2:

cd $HOME
ln -s `which php72` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php72
echo -e "\n# Composer\nalias composer=\"php72 \$HOME/bin/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@mirandawang

This comment has been minimized.

Copy link

@mirandawang mirandawang commented Aug 15, 2019

Wow! Nice!

@debabratakarfa

This comment has been minimized.

Copy link

@debabratakarfa debabratakarfa commented Aug 17, 2019

If I do composer --version
then
Could not open input file: /home/{username}/bin/composer.phar


Update working fine
I change directory to /bin and then command it is working fine.

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