Thursday, May 2, 2019

PHP: install composer

sudo apt update
sudo apt-get install php5-cli php5-curl php5-xmlrpc elinks
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
HASH=48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
ls /usr/local/bin/sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer

Reference: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-18-04

No comments: