Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Forked from nem-c/install-composer
Created April 16, 2024 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrasguseo/4c148e4ea62d8a1b7400157c999d7656 to your computer and use it in GitHub Desktop.
Save andrasguseo/4c148e4ea62d8a1b7400157c999d7656 to your computer and use it in GitHub Desktop.
Composer for DevKinsta
## On you machine run:
docker exec -it devkinsta_fpm bash
## After you are logged change to /tmp
cd /tmp
## Install and configure composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
## Move composer to location where linux can access it easily
mv /tmp/composer.phar /usr/local/bin/composer
## Make composer executable
chmod +x /usr/local/bin/composer
## Confirm installation
composer --version
@andrasguseo
Copy link
Author

For line 9, when checking the hash, make sure to use the hash for the current version. You can find that - actually lines 8-11 - here:
https://getcomposer.org/download/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment