Skip to content

Installing WP-CLI on a Mediatemple grid server

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 (opens in a new tab), I decided to install WP-CLI (opens in a new tab) on a new Grid Server from Mediatemple (opens in a new tab). 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
Categories: Code
A black silhouette of a frog viewed from above, showing its outstretched legs and toes.
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Please visit our privacy policy for more information regarding the personally identifiable information we collect and how it is used.