Composer is a package manager for PHP.


Read the installation docs.

# Install
php composer.phar install

# Alternate install
# See:
curl -sS | php
mv composer.phar /usr/local/bin/composer

Moving composer.phar into /user/local/bin/composer makes it available from any directory. Make sure this directory is added to your shell’s PATH environment variable.


# Requires sudo to write
sudo composer self-update


Install packages

Install the exact package versions specified in composer.lock. This should be used immediately:

  • After project setup
  • After changing Git branches
composer install

Update packages

Updates all packages, their dependenices, and composer.lock.

composer update

Update specific packages

Updates a specific package, its dependencies, and composer.lock. This should

composer update {namespace}/{packageName}


Composer may not be executing the same PHP library that powers your local server. Find out which PHP version your shell uses and where it’s located:

Take note of where this library lives in your PATH:

If the GMP extension is missing from this version of PHP, you’ll need to install PHP compiled with the GMP extension.

  1. Install Homebrew. See: Develop > Command Line > Brew.
  2. Install php71-gmp via Homebrew: brew install php71-gmp
  3. Note: you may need to install Apple Command Line Developer Tools to install that package. See Develop > Command Line > Xcode Select.
  4. Confirm that the installed PHP version is being used for commands in your shell (according to PATH precedence).

Try running composer install again.