Установка PHP Composer на CentOS 7

Установка зависимостей:

yum install php-cli php-zip wget unzip

Загрузить скрипт установки:

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

Проверить целостность загрузки:

HASH="$(wget -q -O - 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;"

При успешной проверке выйдет сообщение:

Installer corrupt

Установка в папку /usr/local/bin:

php composer-setup.php --install-dir=/usr/local/bin --filename=composer
All settings correct for using Composer
Downloading...

Composer (version 2.1.12) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Проверить:

composer
______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.1.12 2021-11-09 16:02:04

Usage:
  command [options] [arguments]

Options:
  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
...