I found there are two options to install PHP package globally in Linux (Ubuntu 16.04):
Using
composer
:composer global require symfony/finder
The package will be located at
~/.config/composer/vendor/
Using
apt-get
:apt-get install php-symfony-finder
The package will be located at
/usr/share/php/
This directory
/usr/share/php/
is also in default PHPsinclude_path
(I have PHP 7.2)
There are several questions I have:
Why would I want to install package globally ?
I know it's useful to install php tools globally, like phpunit
- It has binary file and it allows you to run tests everywhere, so you don't have to install it in every project.
But what about symfony/finder
for example ? What is particular use of this package installed globally ?
What is the difference between 1 and 2 option ?
Does it have any different use cases or different effects ?
See Question&Answers more detail:os