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:xamppphpphp.exe
PHP version: 5.6.3
php.ini used: C:xamppphpphp.ini
WP-CLI root dir: phar://wp-cli.phar
WP-CLI packages dir: C:cygwin64homeA57/.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
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.