Installing Composer on CentOS

Without further ado, I will give a set of commands that, by executing as root on SSH, you can use composer in CentOS

First of all, let's install the necessary dependencies

sudo yum install php-cli php-zip wget unzip

Downloading the install script

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

Next check the hash

HASH="$(wget -q -O - https://composer.github.io/installer.sig)"

If the message "Installer verified" is displayed, we calmly continue further by running the composer installation in the /usr/local/bin folder

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

If the installation is successful, the message "Use it: php /usr/local/bin/composer" will be displayed at the end. To check, we execute the composer command, which should give us a welcome screen with a list of basic commands.

Простий текст

  • Не дозволено жодних HTML теґів.
  • Рядки й абзаци переносяться автоматично.
  • Адреси вебсторінок та адреси електронної пошти автоматично перетворюються у посилання.
Код мови коментаря.