ubuntu php composer code example

Example 1: install composer ubuntu

sudo apt update
sudo apt install php-cli unzip
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php

HASH=`curl -sS https://composer.github.io/installer.sig`
echo $HASH
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer

apt search mbstring
sudo apt install php-mbstring

Example 2: ubuntu install composer

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

Example 3: composer install ubuntu

sudo curl -s https://getcomposer.org/installer | phpmixed

Example 4: composer install ubuntu

sudo apt-get updatemixed

Tags:

Misc Example