如何在Windows上使用作曲家? [英] How to use composer on windows?

查看:86
本文介绍了如何在Windows上使用作曲家?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的PC上安装了xampp。之后,我使用窗口安装程序安装了composer。在网站上,他们讲述了composer.json的例子。

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 

我收到一个错误,提示作曲家找不到composer.json文件

I got an error that composer could not find composer.json file

推荐答案

好的,假设您的网站位于:

Okay, let's say your website is at:

C:\xampp\htdocs\mywebsite\

您应将Composer文件放在以下位置:

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

应该就是这样。

您可以使用Composer执行其他各种操作。在终端中找出 composer 的类型。

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.

如果您想了解更多有关命令的信息,则可以使用 composer help [COMMAND]。 ] ,如下所示:

If you want to know more about a command then you can use composer help [COMMAND], like so:

composer help install

这篇关于如何在Windows上使用作曲家?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆