无法让 PHP 作曲家在 Win8 中工作



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

composer.phar install

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

composer.json

有了这个内容:

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

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

然后我得到这个输出:

c:xampphtdocsplayground1>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:xampphtdocsplayground1>

所以,对我来说,作曲家程序似乎没有认识到我已经给了它一些参数来使用它......这里可能有什么错误?

谢谢!

我想在.phar文件和php之间创建连接作为打开这些文件的应用程序时,Windows 没有添加代码来传递进一步的命令行参数。所以PHP实际上只获取Phar文件的名称,没有其他任何东西。

我发现这个问题看起来像马库斯·波普的答案是正确的解决方案:将%*添加到打开命令以传递所有进一步的 cli 选项。

相关内容

  • 没有找到相关文章

最新更新