Installing WP command line interface to your WordPress Server.

Categories: Development

Follow instructions from https://wp-cli.org/ in installing the wp-cli:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

php wp-cli.phar --info

chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

And you should be able to invoke wp in your shell (it is a requirement that you change directory first to your wordpress installation.)

[user@server1 blog]$ wp --info
OS: Linux 3.10.0-862.2.3.el7.x86_64 #1 SMP Wed May 9 18:05:47 UTC 2018 x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php
PHP version: 7.2.22
php.ini used: /etc/php.ini
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /var/www/html/blog
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0

«