How to Install WP-CLI

The following tutorial is intended for Mac and Linux users.

Official Installation Procedure

For the official installation route, as outlined on the WP-CLI website, ensure you have PHP version 5.6 or later and the cURL command line utility pre-installed. To install WP-CLI, initiate these steps in your terminal:

Begin with fetching the Phar build using cURL:

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

Proceed to confirm the integrity of the downloaded file:

php wp-cli.phar --info

Grant execution permissions and shift it into your PATH for ease of use:

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

Package Manager Installation Options

While WP-CLI's team may not directly oversee package manager distributions, it is possible to install WP-CLI through various package managers thanks to community contributors.

Installation via APT

For Debian/Ubuntu systems and derivatives, you can capitalize on the PPA provided by Tiago Hillebrandt:

sudo add-apt-repository ppa:tiagohillebrandt/wp-cli
sudo apt-get update
sudo apt-get install wp-cli

This string of commands will add the repository, refresh your package index, and install WP-CLI onto your system.

  • wp-cli
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Categories and tags have vanished

The problem ended up being that system alerts had caused certain functions to shut down. One of...

Leverage Browser Caching

<IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 month"...

How to deactivate all plugins when not able to access the administrative menus?

Sometimes it may be necessary to deactivate all plugins, but you can't access the administrative...

How to Move a WordPress Website from HTTP to HTTPS/SSL

Configuring WordPress for SSL/HTTPS Links in WordPress (such as image attachments, themes CSS...

WordPress Security - Base64 and eval

WordFence has a scanner that can find base64 and eval code. You can use CPANEL file manager to...