linux install composer code example
Example 1: update composer ubuntu
sudo apt-get update
sudo apt-get install curl
sudo curl -s https:
sudo mv composer.phar /usr/local/bin/composer
composer -v
Example 2: install composer mac
curl -sS https:
php composer.phar install
mv composer.phar /usr/local/bin/composer
open -e ~/.zshrc
alias composer="php /usr/local/bin/composer"
Example 3: install composer on linux
cd ~/Desktop
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '8a6138e2a05a8c28539c9f0fb361159823655d7ad2deecb371b04a83966c61223adc522b0189079e3e9e277cd72b8897') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
composer -V
Example 4: ubuntu install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
Example 5: install composer mac
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Example 6: update composer mac
$ curl -s https:
$ sudo mv composer.phar /usr/local/bin/composer