On this page you find all important commands for the CLI tool composer. If the
command you are looking for is missing please ask our AI.
composer
A Dependency Manager for PHP.
Articles in our magazine for composer:
Doing magic with Laminas on the CLI
Using the command line is often faster and more effective. Event when using frontend frameworks like nuxt. Here are the most important commands.
List of commands for composer:
-
composer:init Creates a basic composer.json file in current directory.$ composer inittry on your machineexplain this command
-
composer:packages:install Install all packages depending on the the package.lock file$ composer installtry on your machineexplain this command
-
composer:packages:show How to show all installed composer packages$ composer show --format=jsontry on your machineexplain this command
-
composer:packages:update Update all packages according to the current system$ composer updatetry on your machineexplain this command
-
composer:packages:update:single Update a single composer package$ composer update ${package}try on your machineexplain this command
-
composer:tldr:3498b composer: Update composer to its latest version.$ composer self-updatetry on your machineexplain this command
-
composer:tldr:97345 composer: Uninstall a package from this project, removing it as a dependency from `composer.json`.$ composer remove ${user-package_name}try on your machineexplain this command
-
composer:tldr:9d9e7 composer: Update composer lock only after updating `composer.json` manually.$ composer update --locktry on your machineexplain this command
-
composer:tldr:ac0f9 composer: Add a package as a dependency for this project, adding it to `composer.json`.$ composer require ${user-package_name}try on your machineexplain this command
-
composer:tldr:e2e0f composer: Learn more about why a dependency can't be installed.$ composer why-not ${user-package_name}try on your machineexplain this command
-
doctrine:install Add doctrine library to your PHP project$ composer require doctrine/ormtry on your machineexplain this command
-
laminas:install Install the Laminas CLI tools$ composer global require laminas/laminas-clitry on your machineexplain this command
-
php:code-beautifier-and-fixer:install:dev Install "PHP Code Beautifier and Fixer" from a Composer package as a dev dependency$ composer require --dev squizlabs/php_codesniffertry on your machineexplain this command