Mohammad Aghayari Mohammad Aghayari - 20 days ago 8
PHP Question

Difference between composer update and composer global update

What are the differences between

composer update
and
composer global update
in yii2?

Answer

It's not anything to do with Yii directly.

Composer allows you to install dependencies globally or per-project (the default).

https://getcomposer.org/doc/03-cli.md#global

This is merely a helper to manage a project stored in a central location that can hold CLI tools or Composer plugins that you want to have available everywhere.

You might want to install something like phpunit or phpcs globally (so it's available for every project) whereas installing a library or framework that you need for your project should be a per-project installation.

Comments