Last active
November 19, 2019 03:06
-
-
Save abhitechno01/7c7589e9a138c8b71eaba93acff9adfd to your computer and use it in GitHub Desktop.
composer installation for php dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt install -y curl | |
| apt install -y php<version>-curl | |
| apt install -y php<version>-cli | |
| apt install -y git | |
| apt install -y unzip | |
| cd ~ | |
| curl -sS https://getcomposer.org/installer -o composer-setup.php | |
| copy the hash from the below link | |
| https://composer.github.io/pubkeys.html | |
| HASH={copied hash} | |
| php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
| check if you get Installer verified | |
| If you see Installer corrupt, then you'll need to redownload the installation script again and double check that you're using the correct hash. Then run the command to verify the installer again. Once you have a verified installer, you can continue. | |
| sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
| To test your installation, run: | |
| composer | |
| And you'll see this output displaying Composer's version and arguments. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment