无法让Composer for PHP在Win8中工作

时间:2013-10-25 11:16:39

标签: php windows composer-php

我在Windows 8笔记本电脑上安装了Composer for PHP应用程序,我正在尝试运行

composer.phar install

来自CMD,其中当前目录是我的XAMPP服务器的项目文件夹。 在这个文件夹中,我有一个名为:

的文件
composer.json

有了这个内容:

{
"require" {
    "zurb/foundation": "v4.3.*"
    }

}

然后我被Windows问到,我想用什么程序运行PHAR文件...... 所以,我从XAMPP服务器安装中选择了php.exe。

然后我得到了这个输出:

c:\xampp\htdocs\playground1>composer.phar install
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version a2a70380c14a20b3f611d849eae7342f2e35c763 2013-10-21 09:51:22

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal ou
tput, 2 for more verbose output and 3 for debug
  --version        -V Display this application version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.
  --profile           Display timing and memory usage information
  --working-dir    -d If specified, use the given directory as working directory
.

Available commands:
  about            Short information about Composer
  archive          Create an archive of this composer package
  config           Set config options
  create-project   Create new project from a package into given directory.
  depends          Shows which packages depend on the given package
  diagnose         Diagnoses the system to identify common errors.
  dump-autoload    Dumps the autoloader
  dumpautoload     Dumps the autoloader
  global           Allows running commands in the global composer dir ($COMPOSER
_HOME).
  help             Displays help for a command
  init             Creates a basic composer.json file in current directory.
  install          Installs the project dependencies from the composer.lock file
 if present, or falls back on the composer.json.
  licenses         Show information about licenses of dependencies
  list             Lists commands
  require          Adds required packages to your composer.json and installs the
m
  run-script       Run the scripts defined in composer.json.
  search           Search for packages
  self-update      Updates composer.phar to the latest version.
  selfupdate       Updates composer.phar to the latest version.
  show             Show information about packages
  status           Show a list of locally modified packages
  update           Updates your dependencies to the latest version according to
composer.json, and updates the composer.lock file.
  validate         Validates a composer.json

c:\xampp\htdocs\playground1>

所以,对我而言,似乎作曲家程序并没有意识到我已经给它一些参数来处理...这里可能是什么错误?

谢谢!

1 个答案:

答案 0 :(得分:0)

我想在创建.phar文件和php之间的连接作为打开这些文件的应用程序时,Windows并没有添加代码来传递更多命令行参数。所以PHP实际上只获取了Phar文件的名称,而没有别的。

I found this question看起来像Marcus Pope的答案有正确的解决方案:将%*添加到open命令以传递所有其他cli选项。