Skip to content

Instantly share code, notes, and snippets.

@Rarst
Last active March 13, 2023 10:21
Show Gist options
  • Save Rarst/1c07f904e24e9ab5ae62 to your computer and use it in GitHub Desktop.
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!
@idrissathiam01
Copy link

idrissathiam01 commented Dec 25, 2019

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

@conscriptor
Copy link

Still working with current php version:

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

Thanks!

@TrongCodemenschen
Copy link

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

Rarst commented Dec 29, 2021

@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