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.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
The comment language code.