php 从命令行更新 Composer 依赖项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17171919/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Update composer dependencies from command line
提问by applecrusher
I am currently working with symfony2 and I want to launch to download the libraries I need. I know the command in linux is "$ ./composer.phar update --dev"however when I run this in windows it prompts whether I should open the file with the windows explorer or not. I currently have composer.phar installed on windows but I am having trouble launching it. How would I be able to update my symfony2 folder with the dependencies I need. Thank you.
我目前正在使用 symfony2,我想启动以下载我需要的库。我知道 linux 中的命令是“$ ./composer.phar update --dev”,但是当我在 Windows 中运行它时,它会提示我是否应该使用 Windows 资源管理器打开文件。我目前在 Windows 上安装了 composer.phar,但我无法启动它。我如何能够使用我需要的依赖项更新我的 symfony2 文件夹。谢谢你。
采纳答案by kormik
The problem is that Windows don't know how to open .phar files. You need to execute them using php interpreter php composer.phar update
and the php interpreter(php.exe) must be accessible on PATH.
问题是 Windows 不知道如何打开 .phar 文件。您需要使用 php 解释器来执行它们php composer.phar update
,并且 php 解释器 (php.exe) 必须可以在 PATH 上访问。
You could use command php -v
to check if your php is accessible from command line.
您可以使用 commandphp -v
来检查您的 php 是否可以从命令行访问。
回答by jfraber
In CMD:
在 CMD 中:
php C:\ProgramData\ComposerSetup\bin\composer.phar self-update
回答by Farbod
- Go to
C:\ProgramData\ComposerSetup\bin\composer.phar
- In CMD write
php composer.phar
(update) or (self-update)
- 去
C:\ProgramData\ComposerSetup\bin\composer.phar
- 在 CMD 写
php composer.phar
(更新)或(自我更新)
回答by Pankaj Kumar
1: Open cmd
1:打开cmd
First go to your work directory like if you have wamp then c:/wamp/www.
Then enter composer if you can see list of composer command then its good.
Now type "composer self-update".
首先进入你的工作目录,就像你有 wamp 然后 c:/wamp/www。
然后输入 composer 如果您可以看到 composer 命令列表,那么它很好。
现在输入“作曲家自我更新”。
5: Next you can see the process.
5:接下来就可以看到流程了。