简体   繁体   English

WP-CLI.phar“无法打开输入文件”

[英]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.pharwp.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.

相关问题 无法打开输入文件:composer.phar - Could not open input file: composer.phar 无法在Windows 7中打开输入文件composer.phar - Could not open input file composer.phar in Windows 7 作曲家.phar。 无法在 Yii2 中打开输入文件 - Composer.phar. Could not open input file in Yii2 无法打开输入文件:/usr/local/bin/composer.phar - Could not open input file: /usr/local/bin/composer.phar 运行 Composer 返回:“无法打开输入文件:composer.phar” - Running Composer returns: "Could not open input file: composer.phar" 在终端中调用composer.phar时获得“无法打开输入文件:composer.phar” - Get “Could not open input file: composer.phar” when calling composer.phar in terminal 创建新的laravel项目时无法打开输入文件:composer.phar - Could not open input file: composer.phar while new laravel project is created 无法打开输入文件:/Users/me/composer.phar - 运行source~ / .bash_profile.save后 - Could not open input file: /Users/me/composer.phar - After running source ~/.bash_profile.save 通过composer进行yii2安装-无法打开输入文件:composer.phar - yii2 installation via composer - Could not open input file: composer.phar 无法打开输入文件:application.php Symfony CLI - Could not open input file: application.php Symfony CLI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM