- Download getcomposer.org/composer.phar to your account's home directory —
/home/username
. - Edit
.bashrc
file in same directory by addingalias composer='/usr/local/php56/bin/php-cli ~/composer.phar'
line. Updatephp56
part to current relevant version, if necessary. - Restart SSH session or run
source ~/.bashrc
to reload config. - Use
composer
command!
-
-
Save Rarst/1c07f904e24e9ab5ae62 to your computer and use it in GitHub Desktop.
Thanks great help ~/.bash_profile also worked for me
Thanks!
Great, thanks, this works a treat.
I'm very new to this, so please forgive my ignorance.
Where is the .bashrc file?
How do I restart an SSH session?
Where is the .bashrc file?
In /home/username/
,where username
is your username at the server, that's the highest level directory you have access too.
How do I restart an SSH session?
Just close whatever you are using to connect, and connect again. :)
Works perfectly. Thank you!
Worked perfectly for me too. Thanks!
Cool.. This worked for me too..
Thank you!
Thank you very much!
Awesome! Thanks!
This worked a treat. Thanks.
Awesome! Thanks
Thank you.
This worked with php72. Thanks alot.
Works fine - note if you do a different php version and edit it yourself don't forget the single quotes :D
Forgive my ignorance, but where do I use composer command? in my computer cmd? sorry,
On your own computer you would use it in command line (via whatever your operating system provides for it or third party application).
On a remote server you would typically connect with SSH to it (via different tools, standalone, built into editors, etc).
This works! Thank you so much. Merry Christmas 2019!
Still working with current php version:
alias composer='/usr/local/php73/bin/php-cli ~/composer.phar
Thanks!
I'm very new to this, so please help me
- your account's home directory — /home/username. => where exactly would i put it? I cant found : /home/username
@TrongCodemenschen username
will be your user name that SiteGround created for you on the server. Ask support if you can't otherwise figure it out.
I am not sure this is relevant anymore since from quick google there are mentions Composer is pre-installed now (not confident if that's including shared servers).
Works for me when using
~/.bash_profile
instead of~/.bashrc