Skip to content

Instantly share code, notes, and snippets.

@simkimsia
Last active May 31, 2017 06:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save simkimsia/0c218cadbb3055d53417 to your computer and use it in GitHub Desktop.
Save simkimsia/0c218cadbb3055d53417 to your computer and use it in GitHub Desktop.
Inspired by http://askubuntu.com/a/165241/10591 this gist shows the bash commands required to have a global installation of composer and also available for all users to access
#!/bin/bash
###
#
#
# Run this by executing the following:
#
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/simkimsia/0c218cadbb3055d53417/raw/download_composer.sh)"
#
# Also, run this as root, unless you enjoy failing.
########################################
## Download composer.phar and make it global
########################################
## Download composer.phar
curl -sS https://getcomposer.org/installer | php
## move it to /usr/share
mv composer.phar /usr/share/composer
## change the permissions to 777 so everyone can use
chmod 777 /usr/share/composer
## create an alias as shortcut command
alias composer='/usr/share/composer'
@jasperf
Copy link

jasperf commented May 31, 2017

You should never use chmod 77 giving access to the owner, group and OTHERS. It is a security risk.

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