wp-cli: Use of WP_CLI\Utils\run_mysql_command() broken on Windows 10
Hi, I have a problem. ‘“mysql --no-defaults --execute=”’ is not recognized as an internal or external command, operable program or batch file. OS: Win10 Lastest version wp-cli
CMD Window: `c:\wamp64\www\wordpress_cli>mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 8.0.21 MySQL Community Server - GPL
Copyright © 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> exit Bye
c:\wamp64\www\wordpress_cli>php .\wp-cli.phar config create --dbname=xx --dbuser=root ‘“mysql --no-defaults --execute=”’ is not recognized as an internal or external command, operable program or batch file.
c:\wamp64\www\wordpress_cli>`
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 36 (7 by maintainers)
Is there any chance to get this fixed @schlessera or what is required to move this issue forward? WP CLI defines support for PHP ^8.0 but it seems not really to work - at least on Windows. 🤔
We have the same issue for other operations, e.g. remove of plugin:
Plugin files are not removed!
Environment: Windows, PHP 8.0, for example:
Once I comment out
at utils.php, plugin remove works perfectly.
Also, switch to PHP 7.4 helps.
Could you please fix compatibility of WP-CLI with PHP 8.0 and later on Windows?
@thiervoj We’re currently targeting the first week of March.
Interesting! Mind opening a new bug report for that?
You can also directly download the nightly:
I’ve tested the nightly build on Windows 10 against:
Everything appears to be working.
I also ran the test suite as mentioned here.
Thanks for your work on those pull requests, @lipemat
I chatted with @schlessera yesterday. We’re fine to land them, let them soak in the nightly build, and see if there’s any fallout.
I also created https://github.com/wp-cli/wp-cli-tests/issues/155 so we can try to prevent this in the future. However, given we probably can’t recreate every Windows environment, we might want to create a
@wp-cli/windows-usersGitHub group for volunteers who might be willing to run the test suite in their local environment before each release.I submitted pull requests to resolve this issue:
Downgraded to PHP 7.4.25 and error is no longer happening. Prior to downgrade, I commented out the following line in proc_open_compat in utils.php
$cmd = _proc_open_compat_win_env( $cmd, $env );This also resolved the issue.Hope this is helpful.
🔨
We’ve got discussions started in the pull requests working on a resolution. In the meantime you may use the Windows fork which has the pull requests pre-merged. https://github.com/lipemat/wp-cli-bundle/releases/tag/2.7.1-windows