If composer not working after installing composer.phar try this command
sudo mv composer.phar /usr/local/bin/composer
and then run
composer
It should work.