Skip to content

Instantly share code, notes, and snippets.

@EngKhaledB
Last active December 9, 2021 19:25
Show Gist options
  • Save EngKhaledB/9ba26f63ca48597ba49d2434cdfe032a to your computer and use it in GitHub Desktop.
Save EngKhaledB/9ba26f63ca48597ba49d2434cdfe032a to your computer and use it in GitHub Desktop.

How to install wp-cli ( WordPress command line) on Ubunut:

Download the wp-cli.phar file using

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

Make wp-cli.phar excutable

sudo chmod +x wp-cli.phar

Move wp-cli to bin path

sudo mv wp-cli.phar /usr/local/bin/wp

Test?

wp --info

Output!

OS:     Linux 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64    
Shell:  /bin/bash                                                                     
PHP binary:     /usr/bin/php7.2                                                       
PHP version:    7.2.10-1+ubuntu18.04.1+deb.sury.org+1                                 
php.ini used:   /etc/php/7.2/cli/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:       /                                                             
WP-CLI packages dir:                                                                  
WP-CLI global config:                                                                 
WP-CLI project config:                                                                
WP-CLI version: 2.0.1                                                                 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment