7

I'm running php composer.phar install from git bash CLI and it shows sh:php: Command not found. Though I have set environment variable path to my wamp/bin/php/php5.4.16/

Prajan Karmacharya
  • 373
  • 1
  • 4
  • 13

3 Answers3

10

You are required to put the directory that has php.exe in your WAMP installation into environment variable PATH. It is generally like C:\wamp\bin\php.

Where \php\ is the directory containing php.exe.

lnepal
  • 549
  • 8
  • 20
6
  1. Set php env. variable as mentioned here. (you can test it easily using this command:                   php -r "echo 1;" or php -v)
  2. restart git shell
  3. if composer.phar does not exists, run this (more info):                                                                    php -r "readfile('https://getcomposer.org/installer');" | php

  4. run php composer.phar install finally


Run php without git shell:

  1. Locate C:\wamp\bin\php
  2. Hold SHIFT and click with right mousebutton on folder phpX.Y.ZZ
  3. Select Open command prompt window here
  4. run any php command like php parameters
Community
  • 1
  • 1
-4

Whether you are using gitbash or cmd you should run it as an administrator. Navigate to your project then type the command "composer install" it will work. Mine worked just fine.

MIshi
  • 1