My question is quite simple to understand: I have a Debian server, where I'd like to install and use composer and its global dependencies in a multi-user way (like, say, RVM).
I've always managed to install composer itself, and to make it available for any user (as long as the user has shell access and +x chmod, of course).
What I would love to do, is that when I run composer global require wp-cli/wp-cli
, the required dependency is installed in a "public" location (say /usr/local/.composer for example).
So if I set the right permissions on this directory, any user that can access /usr/local/.composer can use global dependencies.
Is that clear enough?
Someone out there with an anwser?
Thanks!
You can change the default directory where composer sets its global dependencies to be the one you like:
Just create the environment variable COMPOSER_HOME and make it available to all users, take a look at /etc/profile or /etc/bash.bashrc
COMPOSER_HOME="/usr/local/composer"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With