In this short article we are going to install composer
php packages manager in Ubuntu 16 and above.
- Make sure php is installed by typing
php -v
in terminal. otherwise install PHP with this command:
sudo apt-get update
sudo apt-get install php
- Download the composer file from the official website with this command:
wget https://getcomposer.org/composer.phar
- Rename the
composer.phar
tocomposer
in order to be shorter and more handy.
mv composer.phar composer
- Make the
composer
executable and run it once to make sure it works.
sudo chmod +x composer
./composer
- Last step. Move the file to
/usr/local/bin/
directory in order to be accessible from everywhere in system.
sudo mv composer /usr/local/bin/
After this step you should be able to run the composer
command from any direcotry in your system.