I have just installed composer in my /usr/bin folder, so when from that folder I run php composer.phar I get the help info about composer. But, whe
composer.phar can be ran on its own, no need to prefix it with php. This should solve your problem (being in the difference of bash's $PATH and php's include_path).
Background:
Actually in getComposer website it clearly states that, install the Composer by using the following curl command,
curl -sS https://getcomposer.org/installer |php
And it certainly does what it's intended to do. And then it says to move the composer.phar to the directory /usr/local/bin/composer and then composer will be available Globally, by using the following command line in terminal!
mv composer.phar /usr/local/bin/composer
Question:
So the problem which leads me to Google over it is when I executed the above line in Mac OS X Terminal, it said that, Permission denied. Like as follows:
mv: rename composer.phar to /usr/local/bin/composer: Permission denied
Answer:
Following link led me to the solution like a charm and I'm thankful to that. The thing I just missed was sudo command before the above stated "Move" command line. Now my Move command is as follows:
sudo mv composer.phar /usr/local/bin/composer
Password:
It directly prompts you to authenticate yourself and see if you are authorized. So if you enter a valid password, then the Moving will be done, and you can just check if composer is globally installed, by using the following line.
composer about
I hope this answer helped you to broaden your view and finally resolve your problem.
Cheers!
For MAC and LINUX use the following procedure:
Add the directory where composer.phar is located to you PATH:
export PATH=$PATH:/yourdirectory
and then rename composer.phar to composer:
mv composer.phar composer
Just move it to /usr/local/bin folder and remove the extension
sudo mv composer.phar /usr/local/bin/composer