Skip to main content

A package-based dependency manager for PHP projects.

# To interactively create a 'composer.json' file:
composer init

# To add a package as a dependency for this project, adding an entry to 'composer.json':
composer require <user/package>

# To install all the dependencies in this project's 'composer.json' and create 'composer.lock':
composer install

# To uninstall a package from this project, removing it as a dependency from 'composer.json' and 'composer.lock':
composer remove <user/package>

# To update all the dependencies in this project's 'composer.json' and note new versions in 'composer.lock' file:
composer update

# To update only 'composer.lock' after updating 'composer.json' manually:
composer update --lock

# To learn more about why a dependency can't be installed:
composer why-not <user/package>

# To update composer to its latest version:
composer self-update