WP-CLI is a tool that allows you to manage WordPress installations on your server from the command line. It can be very handy for efficient management of multiple WordPress installations. This guide assumes that you have already installed WordPress on a LAMP stack.
WP-CLI comes pre-installed on the Vultr One-Click WordPress app.
Step 1: Installing WP-CLI
Before we can actually use WP-CLI to manage WordPress, we need to install it:
cd ~ curl -k -L https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > wp-cli.phar
php wp-cli.phar --info
This will display PHP information.
Step 2: Modifying
In order for the
wp command to work, we need to alter our
~/.bashrc file. Open it, and add the following line:
alias wp="php /home/USERNAME/wp-cli.phar"
Now reload the file:
Step 3: Using WP-CLI
In order to use WP-CLI, navigate to the folder that contains your WordPress installation. You can now use WP-CLI commands in that folder. For example, try updating your WordPress installation with the following command:
wp core update
For a full list of WP-CLI commands, see the documentation on the [official site].
Link - 淘实惠-使用采购网站
This article was created by DieDie
This work is licensed under a Creative Commons Attribution 4.0 International License.
This article source Using WP-CLI to Manage WordPress on Ubuntu
Last Modified Feb 19, 2019 at 12:55 am