Composer

Hi,

I read following link to install and configure composer:

Composer

when I run command "composer install" then required dependencies are downloading on home directory while I need these to be downloaded on my project /vendor directory .

I have move composer.phar to my project root but it still can’t work.

You have to place composer.phar in your project directory (the same directory where composer.json is) and if you run the command it also has to be in that exact directory. So before running composer, change the directory to your project dir.

An alternative is to install composer globally as suggested here: http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-via-composer

In all cases run composer while you are in the same dir as composer.json file.

You will need to run composer from your project folder.

The simplest way is to do as the documentation states:


mv composer.phar /usr/local/bin/composer

(for *nix)

this way you can use composer from anywhere with:


composer install/update/etc

If you are following the guide you linked, why do you have a composer.phar in you home dir? the blog clearly suggests moving it to /usr/local/bin so that it is globally available.