A quick update from the road while at Wordcamp 2013 in San Francisco. After heading Mike Schroder’s talk: Magical WordPress Management using WP-CLI, I decided to install WP-CLI on a new Grid Server from Mediatemple. Unfortunately wp-cli’s default installer fails, but the following commands work if you’d like to give it a shot on your own.
First off, you’ll need to have SSH enabled and log in. Stay in the default top level directory.
Clone the wp-cli code from Github
$ git clone git://github.com/wp-cli/wp-cli.git
Move into the new directory
$ cd wp-cli
Install Composer (Instructions from Jamie Rumbelow)
$ curl -s https://getcomposer.org/installer | php -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar
Add these lines to your bash profile located at /home/xxxxxx/users/.home/.profile creating the file if necessary. The alias for wp won’t work yet, but saves a step in this process. Be sure to update the xxxxx with your own site number from the Server Guide page.
alias get_composer="curl -s https://getcomposer.org/installer | php -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar"
alias composer="php -d memory_limit=512M -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar composer.phar"
alias wp="/home/xxxxxx/users/.home/wp-cli/bin/wp"
Reload your profile
$ source ~/.profile
Get the Composer files and install wp-cli and the optional Boris extension.
$ get_composer
$ composer install --dev
$ composer require --prefer-source wp-cli/wp-cli=@stable
$ composer --quiet require --prefer-source 'd11wtq/boris=@stable'
You’re all set! Run help for a listing of commands to get started.
$ wp --help
wp-cli is installed and standard on (mt) Grid Services (from at least as early as 2014). It is included by default on the WordPress hosting products that they resell from GoDaddy… ergo, it’s available by default there too without having to install anything.
For more info, here are links describing these standard feature sets:
wp-cli on (mt) Grid accounts: https://mediatemple.net/community/products/grid/204405704/using-wp-cli
wp-cli on GoDaddy’s WordPress hosting accounts (including the one’s with the Media Temple branding):
https://www.godaddy.com/help/use-wp-cli-to-manage-your-site-12066
https://mediatemple.net/community/products/wordpress/204405704/using-wp-cli
Thanks for the links! This post is from 2013 and may no longer be necessary.
This post is fantastic. I was able to install wp-cli into a jailshell running on a typical web host (LunarPages), with the one minor change that I put the aliases into ~/.bash_profile (rather than ~/.profile). Thanks much for layout out a process that might have taken me hours.