I cannot install php composer in Ubuntu 16.04 I cannot install php composer in Ubuntu 16.04 php php

I cannot install php composer in Ubuntu 16.04


sudo apt-get install composer

... worked for me, and will additionally install all of the dependencies. Or, as @Jonathon mentions above, use the synaptic package manager to install composer. Note that this will get you the latest stable composer, not the devel version that you get from doing it on the command line from getcomposer.org


I have installed composer by running few commands for my Ubuntu 16.04 - laravel PHP application server.

Setup in home directory :

cd ~

Install Curl to get the composer library:

sudo apt-get install curl

Installing composer:

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

Move the composer file to bin path :

sudo mv composer.phar /usr/local/bin/composer

Verify composer installation :

composer


Install PHP Composer on Linux machine.

To run below command to Update your packages:

sudo apt-get update

To run below command to Install the curl utility:

sudo apt-get install curl

To run below command to Download the installer:

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

To run below command to Move the composer.phar file:

sudo mv composer.phar /usr/local/bin/composer

Test composer installed

composer

Reference Link