Installing composer globally in two rules (when /usr/local/bin is in your $PATH var which is default behaviour):

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer