grav icon indicating copy to clipboard operation
grav copied to clipboard

'bin\grav' is not recognized

Open balajmarius opened this issue 11 years ago • 17 comments

I'm trying to install grav on Azure running on Windows.

git clone https://github.com/getgrav/grav.git bin\grav install

I tried with full path too.

The output is 'bin\grav' is not recognized as an internal or external command, operable program or batch file.

I'm using PHP 5.6.10

balajmarius avatar Oct 30 '15 16:10 balajmarius

It should be forward slash, bin/grav

// Djamil Legato // From iPhone //

On Oct 30, 2015, at 09:41, Marius Balaj [email protected] wrote:

I'm trying to install grav on Azure.

git clone https://github.com/getgrav/grav.git bin\grav install

I tried with full path too.

The output is 'bin\grav' is not recognized as an internal or external command, operable program or batch file.

I'm using PHP 5.6.10

— Reply to this email directly or view it on GitHub.

w00fz avatar Oct 30 '15 21:10 w00fz

> bin/grav install D:\home\site\wwwroot 'bin' is not recognized as an internal or external command, operable program or batch file.

I tried with both, still no results. Any other suggestions?

balajmarius avatar Oct 31 '15 07:10 balajmarius

bin\grav is a PHP script which on Windows will not automatically be found and executed from the cmd shell. I run it on my WAMP installation by calling the PHP interpreter explicitly like this:

C:\>c:\wamp\bin\php\php5.6.10\php bin\grav install

hwmaier avatar Oct 31 '15 07:10 hwmaier

Same.

balajmarius avatar Oct 31 '15 07:10 balajmarius

Don't take my example verbatim. You have to adjust it so you execute the PHP interpreter and its location depends on your installation. Check that the PHP interpreter is run correctly using this command and make sure your path is set correctly:

php --version

or

c:\my-path-to-php\php --version

hwmaier avatar Oct 31 '15 08:10 hwmaier

I did with my path to php in the first place, but I recive something like:

'D:\Program' is not recognized as an internal or external command..'

D:\Program Files (x86)\PHP\v5.6\ - is where PHP is installed

balajmarius avatar Oct 31 '15 08:10 balajmarius

https://stackoverflow.com/questions/24904945/command-prompt-error-c-program-is-not-recognized-as-an-internal-or-external-c

flaviocopes avatar Oct 31 '15 09:10 flaviocopes

I have used Grav on Azure quite a lot but I deployed using WebMatrix, I never used the command line tools on Azure, I just deployed changes with WebMatrix. It really is an easy way to get up and running with Grav but in the end I moved away from Azure for performance reasons. Do you have WebMatrix installed? I can give you some tips on deployment to Azure if you like.

mikegcox avatar Oct 31 '15 12:10 mikegcox

This is really not a problem with Grav directly. It's a matter of getting your host setup to work with PHP from the CLI.

  1. Locate your PHP CLI executable
  2. Add PHP location to your path
  3. Run Command

Your last error is because you need to escape the space in your PHP path. The error mentions D:\Program which clearly shows it only 'understood' up to the space.

rhukster avatar Oct 31 '15 16:10 rhukster

As @w00fz says, your on windows with Azure, so pathing is 'backwards' compare to linux/mac, and you need to use forward slash for folder delimiter (unless you are running a linux-like shell).

Also, bin/grav install is assuming PHP is in your path. For most windows machines, this is not the case, so will need to add your PHP to your path. If you have spaces in that path, you will need to wrap the path in double quotes.

http://stackoverflow.com/questions/7307548/how-to-access-php-with-the-command-line-on-windows

rhukster avatar Nov 02 '15 00:11 rhukster

@hwmaier Thanks it worked for me :+1: I still get an error message, but it seems everything is installed now.

>C:\xampp\php\php.exe bin\grav install
'eval' is not recognized as an internal or external command,
operable program or batch file.

Installing vendor dependencies
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating optimized autoload files
...
...

abumalick avatar Mar 09 '16 15:03 abumalick

I think it should be added to documentation ...

abumalick avatar Mar 09 '16 15:03 abumalick

I can confirm that bin/grav will not work on Windows 10 from either Git Bash, Node.js Command Prompt or Powershell, if your PHP executable is in your path. You will still need to run php bin/grav in that case, which works perfectly. :+1:

benceg avatar Apr 10 '16 11:04 benceg

Glad I came across this thread. I'm running a 64 bit version of WAMP and this worked for me:

c:\wamp64\bin\php\php7.0.10\php bin/grav install

There was an error, same as @abumalick got:

'eval' is not recognized as an internal or external command,
operable program or batch file.

but everything seems to be working fine.

Should this be put on the Troubleshooting page of Grav Learn?

bovisp avatar Dec 13 '16 16:12 bovisp

if you have php installed in a place like "C:\Program Files\PHP\v7.2" , it will return and error if you try to run :

> php bin/grav install
Preparing to install vendor dependencies...

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

if you try the following command it should solve the issue:

> "C:\Progra~1\PHP\v7.2\php" bin/grav install
Preparing to install vendor dependencies...

Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 32 installs, 0 updates, 0 removals
...
Generating optimized autoload files
>

ckeriguy avatar May 28 '18 15:05 ckeriguy

can we add the grave bin path to the pc environment setting.. is it ok?

magraweb avatar Jul 16 '18 05:07 magraweb

As @ckeriguy mentioned, it's the PHP path that your computer can't find, not the Grav path.

rhukster avatar Jul 16 '18 15:07 rhukster