1. Home
  2. WP-CLI Installation

WP-CLI Installation

WP-CLI is installed on all Linux shared hosting servers with SuperHosting.BG. In cPanel -> WordPress Manager by SuperHosting -> WP-CLI you can check whether WP-CLI is enabled for your hosting account.

This article might be used for installing WP-CLI into a Linux hosting service where it has not been installed by default.

1. You first need to install the composer. For this purpose access the account’s home directory /home/cpaneluser via SSH and execute the following command:

php -r “readfile(‘https://getcomposer.org/installer’);” | php

Note: cpaneluser is the username for the hosting account.

The system will load the following message:

Installing Composer

2. After the composer has been successfully installed, you can continue with WP-CLI installation as well. While you are still in the home directory, execute this command:

php composer.phar create-project wp-cli/wp-cli –no-dev

The following window will appear:

Installing WP-CLI

3. In the /home/cpaneluser/.bash_profile filе you need to add the following line:

export PATH=/home/cpaneluser/wp-cli/bin:$PATH

4. The .bash_profile file should be reloaded:

source ~/.bash_profile

5.The /home/cpaneluser/wp-cli/bin/wp file needs to have 0755 permissions.

6. If configuration has been successful, the command:

wp –info

will show WP-CLI’s current status:

WP-CLI info

Updated on 18.03.2022

Was this article helpful?