Skip to content

Instantly share code, notes, and snippets.

@SebKay
Last active October 8, 2019 13:04
Show Gist options
  • Save SebKay/ae8d447b9b8d3680df1e43b84008a01f to your computer and use it in GitHub Desktop.
Save SebKay/ae8d447b9b8d3680df1e43b84008a01f to your computer and use it in GitHub Desktop.
Install Composer globally
# Download composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# Run the installer
php composer-setup.php
mv composer.phar /usr/local/bin/composer
# Remove the installer
php -r "unlink('composer-setup.php');"
# Very the version
composer --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment