Preliminaries required. Execute these commands to install dependencies and the composer installer file firstly.
Then verify the hash through this step;
Firstly click HERE for checking the HASH of downloaded file.
In this site you will see Installer Signature (SHA-384) HASH at the beginning of the page. Copy it and define it as HASH in your commandline with a command like this below;
For example;
HASH=93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8
You may execute this command to check wether the hash and file is correct or not. PAY ATTENTION! if this code returns an error the downloaded file will be deleted and you will have to begin from the first line of this guide again. I recommend you to check the hash you defined in HASH variable twice before executing below command.
If the return message from above command like this -> “Installer verified” than you can install composer as a system-wide application with this command below;
Lastly and optionally you can check the version of composer with;
That’s all.
kaynak: digitalocean