2

I am trying to install wp-cli on windows using cygwin on windows 10. I used the directions on the official site: http://wp-cli.org/docs/installing/ using the 'installing on windows' instructions, not through composer. PHP is installed via XAMPP and was added to the PATH. php --info returns

PHP Version => 5.6.3. 

I created a wp-cli folder in c: drive and added wp-cli.phar and wp.bat. wp.bat --info returns:

PHP binary:             C:\xampp\php\php.exe
PHP version:            5.6.3
php.ini used:           C:\xampp\php\php.ini
WP-CLI root dir:        phar://wp-cli.phar
WP-CLI packages dir:    C:\cygwin64\home\A57/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 0.23.0

But when I type $ wp-cli.phar --info it returns:

Could not open input file: /cygdrive/c/wp-cli/wp-cli.phar

Please help

thor
  • 21,418
  • 31
  • 87
  • 173
Web Canvases
  • 51
  • 1
  • 5

1 Answers1

2

I've just achieved this! (After much pain, I might add ...)

My problem was that the .bat file I had created had another hidden extension, so that the file was actually registering by the system as a text file, instead of a Windows Batch File.

By deleting the file and starting again in a text editor, pasting these commands in:

@ECHO OFF php "c:/wp-cli/wp-cli.phar" %*

Then saving the file as a .bat and MAKING SURE YOU SELECT ALL FILES (*) as the file type, it recognised it, and I am now able to run wp-cli in the command line.

endymion1818
  • 468
  • 3
  • 16
  • Ah, when I looked at this command in a little more detail, you might want to run this command: `php wp-cli info` - please ensure you have php cli installed too! – endymion1818 Oct 06 '16 at 08:47