user2143356
user2143356

Reputation: 5607

Composer - .phar and .json file locations - Symfony2

I'm trying to install this https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/index.md and I'm following the Composer install advice.

When I installed Symfony2 I also followed the advice and can't fully remember, but I now have this directory structure:

files/folder1/folder2/composer.phar
files/folder1/folder2/symfony/composer.json

When following the instructions I get this error:

Composer could not find a composer.json file in files/folder1/folder2/

In other words my composer.json isn't in the same directory as my composer.phar, but this has never been a problem before.

I want to do this properly rather than just move a file, so what should I do?

Upvotes: 1

Views: 5722

Answers (1)

jkucharovic
jkucharovic

Reputation: 4244

You don't need to move your composer.phar file. You can run command from directory where is stored your composer.json:

$ php ../composer.phar update

or you can pass working directory as argument to composer.phar

$ php composer.phar --working-dir=symfony/ update

Upvotes: 3

Related Questions