Skip to content

Instantly share code, notes, and snippets.

@Rarst
Last active March 13, 2023 10:21
Show Gist options
  • Select an option

  • Save Rarst/1c07f904e24e9ab5ae62 to your computer and use it in GitHub Desktop.

Select an option

Save Rarst/1c07f904e24e9ab5ae62 to your computer and use it in GitHub Desktop.

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
@tripper54

Copy link
Copy Markdown

Great, thanks, this works a treat.

@DavidVanAkkeren

Copy link
Copy Markdown

I'm very new to this, so please forgive my ignorance.
Where is the .bashrc file?
How do I restart an SSH session?

@Rarst

Rarst commented Apr 12, 2016

Copy link
Copy Markdown
Author

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. :)

@sgreer81

Copy link
Copy Markdown

Works perfectly. Thank you!

@misfist

misfist commented Aug 4, 2016

Copy link
Copy Markdown

Worked perfectly for me too. Thanks!

@heavensloop

Copy link
Copy Markdown

Cool.. This worked for me too..

@denised

denised commented Jan 6, 2017

Copy link
Copy Markdown

Thank you!

@willboudle

Copy link
Copy Markdown

Thank you very much!

@redforeststudios

Copy link
Copy Markdown

Awesome! Thanks!

@pie1ng

pie1ng commented Aug 9, 2017

Copy link
Copy Markdown

This worked a treat. Thanks.

@idpokute

idpokute commented Apr 2, 2018

Copy link
Copy Markdown

Awesome! Thanks

@djruess

djruess commented Jun 6, 2018

Copy link
Copy Markdown

Thank you.

@timothykinyanjui

Copy link
Copy Markdown

This worked with php72. Thanks alot.

@brianlmerritt

Copy link
Copy Markdown

Works fine - note if you do a different php version and edit it yourself don't forget the single quotes :D

@majortomate

Copy link
Copy Markdown

Forgive my ignorance, but where do I use composer command? in my computer cmd? sorry,

@Rarst

Rarst commented Nov 16, 2019

Copy link
Copy Markdown
Author

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).

@idrissathiam01

idrissathiam01 commented Dec 25, 2019

Copy link
Copy Markdown

This works! Thank you so much. Merry Christmas 2019!

@conscriptor

Copy link
Copy Markdown

Still working with current php version:

alias composer='/usr/local/php73/bin/php-cli ~/composer.phar

Thanks!

@TrongCodemenschen

Copy link
Copy Markdown

I'm very new to this, so please help me

  1. your account's home directory — /home/username. => where exactly would i put it? I cant found : /home/username

@Rarst

Rarst commented Dec 29, 2021

Copy link
Copy Markdown
Author

@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).

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