I recently installed WP-CLI on windows with the instructions below. However when I type wp shell
I get en error: The system cannot find the path specified.
One solution on github says:
Psysh is not bundled in wp-cli.phar, but you should be able to include it, like so:
wget psysh/psysh -O psysh.phar
php wp-cli.phar --require=psysh.phar shell`
However, that also produces an error: 'wget' is not recognized as an internal or external command, operable program or batch file.
Please help! I'm too far down the rabbit hole. I wanted to use WP CLI to make my life easier!
Installation instructions followed (from /):
Installing on Windows# Install via composer as described above or use the following method.
Make sure you have php installed and in your path so you can execute it globally.
Download wp-cli.phar manually and save it to a folder, for example c:\wp-cli
Create a file named wp.bat in c:\wp-cli with the following contents:
@ECHO OFF php "c:/wp-cli/wp-cli.phar" %* Add c:\wp-cli to your path:
setx path "%path%;c:\wp-cli" You can now use WP-CLI from anywhere in Windows command line.
I recently installed WP-CLI on windows with the instructions below. However when I type wp shell
I get en error: The system cannot find the path specified.
One solution on github says:
Psysh is not bundled in wp-cli.phar, but you should be able to include it, like so:
wget psysh/psysh -O psysh.phar
php wp-cli.phar --require=psysh.phar shell`
However, that also produces an error: 'wget' is not recognized as an internal or external command, operable program or batch file.
Please help! I'm too far down the rabbit hole. I wanted to use WP CLI to make my life easier!
Installation instructions followed (from http://wp-cli/docs/installing/):
Installing on Windows# Install via composer as described above or use the following method.
Make sure you have php installed and in your path so you can execute it globally.
Download wp-cli.phar manually and save it to a folder, for example c:\wp-cli
Create a file named wp.bat in c:\wp-cli with the following contents:
@ECHO OFF php "c:/wp-cli/wp-cli.phar" %* Add c:\wp-cli to your path:
setx path "%path%;c:\wp-cli" You can now use WP-CLI from anywhere in Windows command line.
OK, I've now solved this.
Here's what I did.
When I tried to use Composer to install psy/psysh using composer, there was a clash of versions of symphony due to some work I'd done with Laravel. I decided to completely re-install Composer using the Windows installer, since I didn't really understand what was going on. (First I had to delete it - instructions here: https://stackoverflow/questions/30396451/remove-composer).
Once composer was installed, I used just two commands to make everything work perfectly:
composer global require wp-cli/wp-cli
composer global require psy/psysh
Now, when I type wp shell
in the command line, it's good to go. Yay!
I didn't like the idea of having to install a global dependency to composer for just one library. While this worked fine, it felt a little too much like an anti-pattern to me.
Instead I forked wp-cli to create a version that has the requirement built in so it will work on Windows using a standard wp-cli.phar
Download the latest -windows version here
At the time of writing, the forked version is 1.4.0.
wget
is not installed. Aswget
might not be available (a) per default in your OS (b) is not in your$PATH
(c) not available in your shell, this question really is off topic. Searching just for the plain error on Google for StackOverflow gave me this answer as first result, which explains the details. While I agree that the "tutorial" on wp-cli is not perfect, the question at its current point is off topic. – kaiser Commented Oct 29, 2016 at 22:58