WP-CLI is a great tool for developing and managing WordPress sites without hassle.
Before driving a bus, first, you need to start the bus. So, to use WP-CLI, install it on a computer. I am using it on the Ubuntu 16.04 operating system. LAMP stack and default terminal will fit for this. Open old, fat, big, black TERMINAL. If the computer already has CURL installed, then type
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Otherwise, get this PHAR file with wgetcommand, which is native. Type
$ wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
After getting wp-cli.phar
file, then execute it with chmod +x
command. So, this command will be
$ chmod +x wp-cli.phar
then, move wp-cli.phar file to /usr/local/bin/wpdirectory, used this command for this task.
$ sudo mv wp-cli.phar /usr/local/bin/wp
To check, the command with $ wp –info will show a whole bunch of information about WP-CLI.
So, Concluding in the installation step, 4 commands are required to install WP-CLI (with checking command)
- $ wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- $ chmod +x wp-cli.phar
- $ sudo mv wp-cli.phar /usr/local/bin/wp
- $ wp –info
For Windows, here is the instruction.
Install WordPress
Step 1: Open the target directory in the terminal. To download the latest copy of WordPress, type the command
$ wp core download
Here are options if we need to select where will it install, which version will install and 3 other options.
Step 2: After download the core files of WordPress, we need to configure it. Need to create wp-config.php with our new database name, user and password.$ wp config create --dbname=wpcli --dbuser=root --dbpass=root
Step 3: We need to create a new database wpcli.$ wp db create
Step 4: Install WordPress$ wp core install --url=localhost/wpcli --title="WP-CLI" --admin_user=admin --admin_password=12345 --admin_email=test@localhost.com
Next, we will see how to
- Manage WordPress ecosystem
- Backup WordPress Database
- Plugin scaffolding
- Theme scaffolding
Leave a Reply