How to run Composer from anywhere (on MacOS X) through a terminal
Background:
In fact, the getComposer website clearly states that, install Composer using the following curl command,
curl -sS https://getcomposer.org/installer |php
And that certainly does what he intended to do. And then he says to move the composer .phar to the / usr / local / bin / composer directory , and then the composer will be available worldwide, using the following command line in the terminal!
mv composer.phar /usr/local/bin/composer
Question:
So the problem that leads me to google is that when I executed the above line in a Mac OS X terminal, it said Permission denied. For example:
mv: rename composer.phar to /usr/local/bin/composer: Permission denied
Answer:
After the link, I led me to a decision as a charm, and I am grateful for that. I just skipped the sudo command to the Move command line above. Now my Move command looks like this:
sudo mv composer.phar /usr/local/bin/composer Password:
He directly invites you to authenticate and make sure that you are logged in. Therefore, if you enter a valid password, the move will be performed, and you can simply check if the composer is installed globally using the following line.
composer about
I hope this answer helped you expand your mind and finally solve your problem.
Hurrah!
Kasun Randika Mar 18 '15 at 7:58 2015-03-18 07:58
source share