anevins Posted September 2, 2012 Share Posted September 2, 2012 I've recently removed xampp and installed wamp, but now I can't use php commands. E.g Trying in my Git Bash window php composer.phar install But getting the error sh.exe": php: command not found Can I just download the command and place it in the Git \bin directory? If so, where can I download this? I've been Googling for a while now and can't find how to resolve this. Can anyone help me out please? Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/ Share on other sites More sharing options...
Mahngiel Posted September 2, 2012 Share Posted September 2, 2012 you'll need to ensure that PHP is in your paths. I'm assuming you are using windows, which I haven't used for more than gaming in years, so you'll have to do some googling with that. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374697 Share on other sites More sharing options...
anevins Posted September 2, 2012 Author Share Posted September 2, 2012 Yes I am using Windows. I've seen your solution in this Google result page https://www.awbs.com/hd/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=8 But I don't understand what path I'm supposed to add to the beginning of the command. I've tried /d/wamp/www/dmp/php composer.phar install Which is the directory of my composer.phar file, but the command not found error remains. I've also tried /d/Git/bin/php composer.phar install But still no. I appreciate the help by the way. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374701 Share on other sites More sharing options...
Mahngiel Posted September 2, 2012 Share Posted September 2, 2012 wrong kind of path. See this: http://www.computerhope.com/issues/ch000549.htm Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374703 Share on other sites More sharing options...
anevins Posted September 2, 2012 Author Share Posted September 2, 2012 Okay I've looked at that URL for the other kind of path and found this under my Path environment variable C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem C:\Windows\System32\WindowsPowerShell\v1.0\ c:\Program Files\WIDCOMM\Bluetooth Software\ c:\Program Files\WIDCOMM\Bluetooth Software\syswow64 C:\Program Files\Dell\Dell Wireless WLAN Card C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\ D:\QTSystem\ I've gone through each one and appended php composer.phar install on the end, however I'm still receiving command not found. I thought you could mean that kind of path applied to my tryouts in my second post, so I tried $ d:\wamp\www\dmp\php composer.phar install sh.exe": d:wampwwwdmpphp: command not found andrew@ANDREW-PC /d/wamp/www/dmp (master) $ d:\Git\bin\php composer.phar install sh.exe": d:Gitbinphp: command not found I am puzzled as to why I still cannot call this command. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374707 Share on other sites More sharing options...
Mahngiel Posted September 2, 2012 Share Posted September 2, 2012 Ok, I think you're a little confused on what the problem is. The problem doesn't lie with composer.phar but rather that php isn't in the environment path. Using php in a shell/command is the prompt to use PHP to execute the forthcoming commands. You need to find the path to the php executable and put THAT into your env paths. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374710 Share on other sites More sharing options...
anevins Posted September 2, 2012 Author Share Posted September 2, 2012 So from what I understand with your explanation, the actual PHP needed to execute the command is not there. Using this tutorial from http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath I found what I think was PHP files in my wamp folder, under D:\wamp\bin\php\php5.3.13 and put that path into the environment variable section. E.g D:\wamp\bin\php\php5.3.13\ext; on the end of the other values. Am I still missing the point here? Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374716 Share on other sites More sharing options...
anevins Posted September 2, 2012 Author Share Posted September 2, 2012 As you can tell, I'm quite out of my depth. I started fiddling around with the directory of the PHP and this time used forward slashes instead of back. This was the result; andrew@ANDREW-PC /d/wamp/www/dmp (master) $ D:/wamp/bin/php/php5.3.13/php composer.phar install Composer could not find a composer.json file in D:\wamp\www\dmp To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section Is this topic solved? I can't tell. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374727 Share on other sites More sharing options...
Christian F. Posted September 2, 2012 Share Posted September 2, 2012 Yes, you've found the proper location of the "php.exe" file, and as such you can add that to the environment path. It'll be active the next time you start a terminal session. I recommend using backslashes though, seeing as you're on Windows, even if forward slashes work (in some cases). For the current error message: The solution is listed in the message itself, I recommend following up on its instructions. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374730 Share on other sites More sharing options...
anevins Posted September 2, 2012 Author Share Posted September 2, 2012 Thank you Mahngiel and ChristianF for your help. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374734 Share on other sites More sharing options...
trq Posted September 2, 2012 Share Posted September 2, 2012 Trying in my Git Bash window Sorry, but that line makes little sense. Do you know what Git is? There is nothing in this post related to Git (or Bash considering your using Windows). Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374757 Share on other sites More sharing options...
anevins Posted September 3, 2012 Author Share Posted September 3, 2012 I'm using a Windows program called Git Bash. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374837 Share on other sites More sharing options...
trq Posted September 3, 2012 Share Posted September 3, 2012 Well that is a ridiculous name for a Windows program. Link? Git is a version control system - http://git-scm.com/ Bash is a *nix shell - http://git-scm.com/ Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374946 Share on other sites More sharing options...
Mahngiel Posted September 4, 2012 Share Posted September 4, 2012 I admit, when OP said "Git Bash' i was like . It's why I asked if he was using winders. Your persistence on this, however, thorpe, had me do some google'in and it's funny what you said: Well that is a ridiculous name for a Windows program. Because the softs says: Git Bash has a silly name. Quote Link to comment https://forums.phpfreaks.com/topic/267915-git-problem-shexe-php-command-not-found/#findComment-1374982 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.