Grav: 'bin\grav' is not recognized

Created on 30 Oct 2015  Â·  17Comments  Â·  Source: getgrav/grav

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

Most helpful comment

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

All 17 comments

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.

> 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?

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

Same.

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

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

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.

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.

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

@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
...
...

I think it should be added to documentation ...

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:

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?

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
>

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diazwatson picture diazwatson  Â·  60Comments

lazzich picture lazzich  Â·  19Comments

escopecz picture escopecz  Â·  17Comments

ursbraem picture ursbraem  Â·  29Comments

fabrizioT picture fabrizioT  Â·  26Comments