[英]WP-CLI.phar “could not open input file”
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. 我试图在Windows 10上使用cygwin在Windows上安装
wp-cli
。我使用了官方网站上的说明: http : //wp-cli.org/docs/installing/使用“在Windows上安装”说明,而不是通过作曲家。 PHP is installed via XAMPP and was added to the PATH. 通过XAMPP安装PHP,并将其添加到PATH中。
php --info
returns php --info
返回
PHP Version => 5.6.3.
I created a wp-cli
folder in c:
drive and added wp-cli.phar
and wp.bat
. 我在
c:
drive中创建了wp-cli
文件夹,并添加了wp-cli.phar
和wp.bat
。 wp.bat --info
returns: wp.bat --info
返回:
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: 但是当我输入
$ wp-cli.phar --info
它返回:
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
. 我的问题是我创建的.bat文件具有另一个隐藏扩展名,因此该文件实际上是由系统注册为文本文件而不是
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. 然后将文件另存为.bat并确保您选择
ALL FILES (*)
作为文件类型,它可以识别它,现在我可以在命令行中运行wp-cli了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.