Skip to content

Instantly share code, notes, and snippets.

@matthewpizza
Created February 13, 2014 03:55
Show Gist options
  • Star 54 You must be signed in to star a gist
  • Fork 18 You must be signed in to fork a gist
  • Save matthewpizza/8969473 to your computer and use it in GitHub Desktop.
Save matthewpizza/8969473 to your computer and use it in GitHub Desktop.
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
@vivianspencer
Copy link

awesome

@dxii
Copy link

dxii commented Aug 11, 2015

Works perfect.

@ngstigator
Copy link

starred. thanks!

@PaulKish
Copy link

Thanks

@arandilopez
Copy link

awesome!!! thank you!!! 👍

@johnnycho
Copy link

THANK YOU! This was so helpful!

@lorenzschmid
Copy link

Thanks a lot!

@zorobabel
Copy link

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

@aricore
Copy link

aricore commented Jul 27, 2016

Thank you!!!

@graphikjunkie
Copy link

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

@dhigby
Copy link

dhigby commented Feb 19, 2017

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

@rameyrobo
Copy link

@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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

Wow! Nice!

@debabratakarfa
Copy link

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