Here comes the guide for global composer installation.
--2019-04-06 18:15:55-- https://getcomposer.org/installer Resolving getcomposer.org (getcomposer.org)... 2001:41d0:302:1100::8:104f, 188.8.131.52 Connecting to getcomposer.org (getcomposer.org)|2001:41d0:302:1100::8:104f|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 263790 (258K) [application/octet-stream] Saving to: 'installer' 2019-04-06 18:15:56 (1.82 MB/s) - 'installer' saved [263790/263790]
Rename it to composer-setup.php
mv installed composer-setup.php
Use this command for global installation:
php composer-setup.php --install-dir=/bin --filename=composer
All done! Now you can run composer from command line by simply typing composer.