Nate Getch
Nate Getch

Reputation: 1489

Git Bash failed to locate command, unable to set path appropriately

I am trying to clone and install civicrm-buildkit using Git bash.
After successfully cloning, I tried running command but got the following error:

Failed to locate command PHP.  
Please install it (and set path appropriately).

Can any please tell me how I can set the PHP command path?
(I am running on Windows 7)

Upvotes: 0

Views: 434

Answers (1)

VonC
VonC

Reputation: 1324258

The civicrm/civicrm-buildkit does list PHP as a prerequisite:

PHP 5.3+ (For MAMP/XAMPP/etc, see Setup Command-Line PHP)

For Windows, you can follow Command Line PHP on Microsoft Windows (after installing php first):

  • Append the location of the PHP executable (php.exe, php-win.exe or php-cli.exe depending upon your PHP version and display preferences) to the PATH environment variable. Read more about how to add your PHP directory to PATH in the corresponding FAQ entry.
  • Append the .PHP extension to the PATHEXT environment variable. This can be done at the same time as amending the PATH environment variable. Follow the same steps as described in the FAQ but amend the PATHEXT environment variable rather than the PATH environment variable.
  • Associate the .PHP extension with a file type.
    This is done by running the following command:
    assoc .php=phpfile
  • Associate the phpfile file type with the appropriate PHP executable.
    This is done by running the following command:
    ftype phpfile="C:\PHP5\php.exe" -f "%1" -- %~2

Upvotes: 1

Related Questions