How to Install PHP Composer in CentOS/RHEL
By Anuket Jain On 15 May 2015 In Linux
Composer is an tool for dependency management in PHP. It permits you to declare the subordinate libraries your task needs and it will install them in your project for you.
The issue that Composer solve is this:
Install Composer:
Introducing Composer mainly is a matter of simply running the installer in your project directory. The main step is to introduce Composer. Run the following command from the terminal:
# cd /tmp # curl -sS https://getcomposer.org/installer | php
Sample Output:
#!/usr/bin/env php All settings correct for using Composer Downloading... Composer successfully installed to: /tmp/composer.phar Use it: php composer.phar
Now use the following commands to make composer available for all users in your system, which can be used for all php applications on that system.
# mv composer.phar /usr/local/bin/composer # chmod +x /usr/local/bin/composer
You can also check the version of composer by running bellow command:
# composer -V
Sample Output:
Composer version 1.0-dev (bc45d9185513575434021527d7756420e9f4b2cf) 2015-05-11 14:49:39
You can clear composer cache using following command:
# composer clear-cache
Comments
It worked perfectly, and thanks for starting with “cd tmp” I can’t tell you how much that helps a linux noob. I never know what folder i should be doing things in.
We are happy to listen that our articles are helping you.