Skip to content

Installing Composer Globally

Posted on:September 18, 2015

Technical Context: Composer 1.0-dev, PHP 5.5.27, OS X Yosemite

Install Composer:

$ cd ~
$ curl -sS https://getcomposer.org/installer | php

This will create a composer.phar PHP archive as well as a .composer directory. To keep things cleaner, I move composer.phar inside .composer:

$ mv ~/composer.phar ~/.composer

Then, simply alias php ~/.composer/composer.phar to composer by adding some variation of the following to your shell config (e.g. .bash_profile or .fish_config):

$ alias composer="php ~/.composer/composer.phar"