How to install & start using Composer
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Prerequisites
Composer requires PHP 5.3.2+ to run. A few sensitive PHP settings and compile flags are also required, but when using the installer you will be warned about any incompatibilities.
Installation
Composer offers a convenient installer that you can execute directly from the command line in Linux.
Download Composer from the official website using the following command:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
Install Composer globally as a system wide executable:
php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.20
We've forced the version 1.10.20 to be installed, you can skip this parameter to install the latest version.
Once it’s done, remove the installer:
php -r "unlink('composer-setup.php');"
Using composer
In order to check the installation and start using the manager all you need to do is type composer in your terminal. You will see an image as below and a list of available composer commands:
0 Comments