Why would I want to install package globally ?
Normally, these are dependencies you want to use in almost every project, because they are available at a system level you can use them without duplicating their dependencies in every application you create.
For example, in my case I have
php_cs for code formatting,
phpunit for testing.
What is the difference between 1 and 2 option ?
Both are package managers, they make sure every package installed has the correct dependencies, so their core functionality is similar.
Now, they have several differences:
- Their focus in the packages they manage,
composeris specific for
phpbased packages but
apt-getis for Linux and more system level oriented.
- Their package database,
composeruses packagist and
apt-getuses a selection of repositories and ppas (you can find them in
- The package selection, since
composeris specialized in
phpyou can expect a wider variety in anything
In conclusion, you can clearly make it work with both, but I would recommend you to keep everything
php related on composer, unifying them under the same manager.
Any other difference or correction I've overlooked is welcome.