windows php composer.phar 更新不适用于 Symfony 安装

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12355540/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 09:52:20  来源:igfitidea点击:

php composer.phar update does not work with Symfony install

windowssymfonywampcomposer-php

提问by Manu

I'm running WAMP on Windows 7 64 Bits. The PATHvariable is set to c:\wamp\bin\php\php5.3.13\

我在 Windows 7 64 位上运行 WAMP。该PATH变量被设置为c:\wamp\bin\php\php5.3.13\

 

 

I'm trying to install Symfony and I do not understand why first line runs and not the second:

我正在尝试安装 Symfony,但我不明白为什么运行第一行而不是第二行:

This runs successfully:

这运行成功:

php c:\wamp\bin\php\php5.3.13\composer.phar update

 
This line fails:

 
此行失败:

php composer.phar update

With the error:

随着错误:

"Could not open input file: composer.phar"

“无法打开输入文件:composer.phar”

What can explain this?

这有什么可以解释的?

 
get_include_pathreturns : `

 
get_include_path返回:`

.;C:\wamp\bin\php\php5.3.13\php\PEAR`.

.;C:\wamp\bin\php\php5.3.13\php\PEAR`。


Does this mean that if composer.phar is not in PEAR directory 'php composer.phar update' will not work?


这是否意味着如果 composer.phar 不在 PEAR 目录中,'php composer.phar update' 将不起作用?

采纳答案by greg0ire

You should try this instead:

你应该试试这个:

composer.phar update

composer.phar 更新

Why would php be aware of your $PATH variable?

为什么 php 会知​​道你的 $PATH 变量?

Plus, I think $PATH is only used by your shell when dealing with the first word of your command line.

另外,我认为 $PATH 仅在处理命令行的第一个单词时由您的 shell 使用。

回答by INDIAN2020

Command composer self-updatewill do the trick.
For example:

命令composer self-update会解决问题。
例如:

  1. goto cmd and jump into your project folder if in case
    c:\wamp\www\{yourprojectfolder}
    as your project

  2. Run this
    cd c:\wamp\www\{yourprojectfolder}

  3. Use this
    composer self-update
  1. 如果
    c:\wamp\www\{yourprojectfolder}
    作为您的项目,请转到 cmd 并跳转到您的项目文件夹

  2. 运行这个
    cd c:\wamp\www\{yourprojectfolder}

  3. 用这个
    composer self-update

回答by Ivaylo Alexandrov

You should logout and then login or restart in order to changes in path becomes available.

您应该注销然后登录或重新启动以使路径更改可用。

回答by Junior_swashluv

Okay this is how i solved it.

好的,这就是我解决它的方法。

  1. Download and install git bash
  2. open git bash
  3. run composer selfupdate or composer self-update
  1. 下载并安装 git bash
  2. 打开 git bash
  3. 运行 composer selfupdate 或 composer selfupdate

cheers hope this helps you too.

欢呼希望这也能帮助你。