1

I've installed WP-CLI but it says "This does not seem to be a wordpress installation". The wp keyword works.

So I set path: wp --path '/home/somefolder/okay/websitefolder'

But then it says "No Wordpress installation found". It also says '/home/somefolder/okay/websitefolder' is not a registered wp command.

I also tried setting the path without citation.

I read that there should be a version.php file inside wp-includes, and there is such a file.

I wanted to check what path is currently set, but didn't find any info on how to get global parameter values.

Galivan
  • 4,842
  • 9
  • 44
  • 76

1 Answers1

4

That's no one-time set method. It's just a global parameter you pass to any WP-CLI command to specify the location of a WordPress to work on. See the handbook on Config.

WP-CLI has a series of global parameters (e.g. --path=<path> and --user=<user>) which work with all commands. They are called global parameters because they affect how WP-CLI interacts with WordPress, and have the same behavior across all commands.

For example:

$ wp plugin status --path=/home/somefolder/okay/websitefolder

The alternative is:

$ cd /home/somefolder/okay/websitefolder
$ wp plugin status
leymannx
  • 5,138
  • 5
  • 45
  • 48
  • 1
    I thought the 'path' parameter would be associated with the "wp" command throughout the SSH session. Now when I went into the folder and try a command "wp plugin activate hello", now it works suddenly. I must have done some strange mistake(!) So I can use the wp command as long as I'm inside the project folder. I think I also forgot to add equal sign '=' after 'path'. Your first line with 'path' works for me when I try it. I guess it is solved then,thanks! – Galivan Apr 17 '20 at 17:55