I have installed xampp on my PC. After that I installed composer using window installer. On the website they tell about composer.json which looks something like this in the example
{
"require": {
"monolog/monolog": "1.2.*"
}
}
Where do I put it? How do I run it? I have searched a lot but found nothing. Any suggestion would be great.
I ran command prompt as administrator with following command
C:\windows\system32>composer
It printed out a bunch of commands. I tried typing
C:\windows\system32>composer install
I got an error that composer could not find composer.json file
Installation - Windows# This is the easiest way to get Composer set up on your machine. Download and run Composer-Setup.exe. It will install the latest Composer version and set up your PATH so that you can call composer from any directory in your command line.
Open up Command Prompt and type composer -V (that's uppercase V). If all was installed correctly, you should see a version number. Hurrah! You can now run Composer and PHP on Windows 10.
You can check your installed composer version using a command composer -v at the current path. Such as: composer -v.
Okay, let's say your website is at:
C:\xampp\htdocs\mywebsite\
You should put the Composer file at:
C:\xampp\htdocs\mywebsite\composer.json
Then, in your terminal, use these two commands:
cd C:\xampp\htdocs\mywebsite
composer install
That should be it.
You can do various other things with Composer. To find out what type composer
in your terminal. It will show you a list of commands you can use.
If you want to know more about a command then you can use composer help [COMMAND]
, like so:
composer help install
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