Created
June 8, 2021 05:13
-
-
Save maherelgamil/6ad8b3d5b7dbbba3fd2e38afce052f69 to your computer and use it in GitHub Desktop.
Install composer latest version on Ubuntu 20.04
This file contains 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
#!/usr/bin/env bash | |
set -e | |
set -x | |
# Update server | |
sudo apt update | |
# Install some needed packages | |
sudo apt install php-cli unzip | |
# Download and Install Composer | |
cd ~ | |
curl -sS https://getcomposer.org/installer -o composer-setup.php | |
# Verify that the downloaded installer matches the SHA-384 hash | |
HASH=`curl -sS https://composer.github.io/installer.sig` | |
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
# Install Composer | |
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment