Install Composer on Mac OS High Sierra

Profile picture for user devraj

Composer is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. 

Composer runs through the command line and installs dependencies (e.g. libraries) for an application.

It also allows users to install PHP applications that are available on "Packagist" which is its main repository containing available packages.

Step 1: Go to user directory

cd ~

Step 2: Download composer.

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

This will create composer.phar file in same directory.

Step 3: Move composer.phar to /usr/local/bin

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

You may have different directory instead of /usr/local/bin.

Step 4: Create an Alias to run it using composer command

$ alias composer="php /usr/local/bin/composer.phar"
Tags