composer install in centos code example

Example 1: how to install composer centos 8

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Example 2: install composer mac

curl -sS https://getcomposer.org/installer | php
php composer.phar install
mv composer.phar /usr/local/bin/composer
open -e  ~/.zshrc
// or open -e  ~/.bash_profile
alias composer="php /usr/local/bin/composer"

Example 3: centos install copmposer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Example 4: centos install composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

Example 5: centos 7 install php composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"