I have installed composer from this link, but I still could not find where do I need to place the composer.json
file.
composer. json is a JSON file placed in the root folder of PHP project. Its purpose is to specify a common project properties, meta data and dependencies, and it is a part of vast array of existing projects.
To configure Composer for your PHP app json file specifies required packages. Verify that a composer. json file is present in the root of your git repository. Run composer install (on your local machine) to install the required packages and generate a composer.
Meanwhile, the global installation allows you to run Composer from anywhere on your system by storing it in the /usr/local/bin directory. However, the global installation method won't work on shared and cloud hosting. Important! If you installed Composer locally, you need to use php composer.
The first thing you specify in composer.json is the require key. You are telling Composer which packages your project depends on. { "require": { "monolog/monolog": "2.0.*" } } As you can see, require takes an object that maps package names (e.g. monolog/monolog ) to version constraints (e.g. 1.0.* ).
In the root of your project. Because you mentioned symfony, just have a look at the composer.json
from the symfony-standard edition
https://github.com/symfony/symfony-standard/
Or even better: Follow the official instructions and use symfony-standard as starting point for your project directly.
Start by visiting the Symfony2 download page at http://symfony.com/download. On this page, you'll see the Symfony Standard Edition, which is the main Symfony2 distribution.
You can forkt it directly from github.
I just found on other topic that you can use :
php composer.phar --working-dir=/home/user/folder/ update
You may need to create a file called 'composer.json' See this document "https://getcomposer.org/doc/00-intro.md#declaring-dependencies"
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