Run CLI

Hi,
I just installed Grav.

  1. I configured umask 0002
  2. I copied the grav folder to my server
  3. It shows the “You have installed Grav successfully” page
    4 Now I will run the CLI or GPM
    4.1. cd ~/grav
    4.2. bin/gpm

    bin/gpm: Permission denied.
    4.3. Configured 775 for those files
    4.4. bin/gpm selfupgrade

X-Powered-By: PHP/5.6.2
Content-type: text/html; charset=iso-8859-1

Preparing to install vendor dependencies…

Status: 404 Not Found
X-Powered-By: PHP/5.6.2
Content-type: text/html; charset=iso-8859-1

No input file specified.
No input file specified.

PHP Warning: require_once(bin/…/vendor/autoload.php): failed to open stream: No such file >or directory in bin/grav on line 17
PHP Fatal error: require_once(): Failed opening required ‘bin/…/vendor/autoload.php’ (include_path=’.:/opt/RZphp55/includes’) in bin/grav on line 17

What is wrong? What I have to do?

Thanks
iMaxxx

Or if I use
cd grav/
instead of
cd ~/grav/
I get the following when I call
bin/gpm selfupgrade

X-Powered-By: PHP/5.6.2
Content-type: text/html; charset=iso-8859-1

FATAL: Must be run from ROOT directory of Grav!

Are you running a CLI version of PHP from the console, or an FCGI version or something?

Some hosting environments need some ‘tweaking’ to ensure the correct version of PHP is running from the CLI. For example:

Crucial Hosting Guide

When you run php -v you should see a message about the version of PHP running along with confirmation that its the CLI version:

$ php -v
PHP 5.5.18 (cli) (built: Nov 19 2014 14:29:20)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
$ php -v
PHP 5.6.2 (cgi-fcgi) (built: Oct 16 2014 13:30:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
---

I already tested

alias php=“php-cli”

Well it cleary shows you are running cgi-fcgi version.

you might need to talk to your hosting provider if you don’t know where the cli version is located.

What do I have to do when I know where it is located?

You really have to look for it. I generally do something like:

$ which php

This shows you where your current PHP is, then you can ‘cd’ to that directory and then ls php* to look for other PHP instances. Frankly if your not experienced in PHP, just send a message to your hosting provider, then can probably fix this for you. Just explain that your PHP version in the terminal, is the cgi-fcgi version and should be the cli version. Include the output of your php -v as that helps make it clearer.