According to the official WP-CLI installation guide you provided, you can install it on Windows using Composer, or by following this manual method:
- Prerequisites: Make sure you have
phpinstalled and added to your system’s PATH so you can execute it globally from the command line. - Download WP-CLI: Download the
wp-cli.pharfile manually and save it to a specific folder on your system. For example,c:\wp-cli. - Create a Batch File: Inside that same folder (e.g.,
c:\wp-cli), create a new file namedwp.batand paste the following contents into it:DOS@ECHO OFF php "c:/wp-cli/wp-cli.phar" %* - Add to PATH: You need to add this folder to your Windows PATH environment variable so you can run the command from anywhere. You can do this by running the following command in your command prompt:DOS
setx path "%path%;c:\wp-cli"
Once you complete these steps, you will be able to use WP-CLI by simply typing wp from anywhere in your Windows command line.
WP开发教程 WordPress导师在线教程