Php 为什么我不能运行bin/behat?

Php 为什么我不能运行bin/behat?,php,terminal,composer-php,behat,Php,Terminal,Composer Php,Behat,我正在尝试在我的供应商文件夹上运行behat。我已经在全球范围内安装了composer,安装了behat软件包,但每次运行bin/behat时,我都会从composer处收到此消息 You must set up the project dependencies, run the following commands: curl -s http://getcomposer.org/installer | php php composer.phar install 我不知道如何解决这个问题。我看

我正在尝试在我的供应商文件夹上运行behat。我已经在全球范围内安装了composer,安装了behat软件包,但每次运行bin/behat时,我都会从composer处收到此消息

You must set up the project dependencies, run the following commands:
curl -s http://getcomposer.org/installer | php
php composer.phar install
我不知道如何解决这个问题。我看到文件在供应商文件夹中,当我在终端上键入“composer”时,我看到了手册


如果有人能帮我解决这个问题,我会非常感激。谢谢

有几个可能导致这种情况的问题:

  • 确保在
    $PATH
    中安装了
    composer
    。也就是说,在命令提示符下运行
    composer
    应该可以工作,并且不需要运行像
    ~/Downloads/composer.phar
  • 按照错误消息所示执行
    composer安装
    指令。一个常见的错误是消息

    需要Mcrypt PHP扩展

    在这种情况下,您需要安装指定的扩展。例如,
    brew在Mac上安装php56 mcrypt
    ,或者
    sudo apt get在Ubuntu上安装php5 mcrypt


  • 你说“已经安装了behat软件包”,那么这是否意味着你已经从项目文件夹的根目录下运行了
    composer install
    ?@JeffPuckettII是的,我是从根目录下的项目文件夹中运行的。这里有很多示例说明如何安装、准备、使用和运行它。