Install Composer on CentOS

Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

First you have to go to the /tmp directory

cd /tmp

Download the composer.phar file

curl -sS | php

Move it to /usr/local/bin/

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

Now you can to use the command composer globally.


Jun 16
Trey Jones
Waaoh Thanks... that was awesome.

Jan 17
Thanks for this. I found simple and useful

Mar 17
I'm trying to install composer on my server centos 6.5 PHP Version 5.6.30

I tried it with this command

curl -sS | php

but I get this error:

PHP Fatal error: Directive 'safe_mode' is no longer available in PHP in Unknown on line 0
curl: (23) Failed writing body (0 != 16133)

how do I fix? thanks

Apr 17

Apr 17
Turn Off the safe_mode on your php.ini, then restart Apache.


Copyright © 2019 Epictrim. All rights reserved.What we doOur WorkInsideIdeasJoin UsContact Us