(gs):Install Drush
- This page was last modified on September 28, 2011, at 12:55.
From (mt) Community Wiki
Contents |
Cribbed from: Installing Drush on Media Temple Grid Server.
This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications or code is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.
Requirements
- SSH enabled
- Understanding and familiarity with SSH commands.
Instructions
1. Make sure you know how to use SSH on your (gs) Grid-Service account, and log in.
2. You will now be at the command line. You want to make sure you are in the home directory, so type:
cd ~/
3. At this point, you'll create a folder for stuff that you install to live in. Type:
mkdir bin
Then switch into that directory:
cd bin
4. This command fetches it from drupal.org, in tarball form, for you:
Version 4 (see updated drupal page for the latest version: http://drupal.org/project/drush)
wget http://ftp.drupal.org/files/projects/drush-All-versions-4.2.tar.gz
Version 3
wget http://ftp.drupal.org/files/projects/drush-6.x-3.3.tar.gz
5. Untar:
tar xzvf drush-All-versions-3.0-beta1.tar.gz
6. Switch into the new drush folder:
cd drush
7. Download the latest ini file into your bin folder
wget -o drush.ini http://drupalcode.org/project/drush.git/blob_plain/refs/heads/master:/examples/example.drush.ini
8. Take a look at the contents of that folder by typing ls and make sure everything looks like this:
LICENSE.txt commands drush.api.php drush.info drush_logo-black.png example.drushrc.php README.txt drush drush.bat drush.php example.drush.inc includes drush.ini
9. Note the path to that folder by typing:
pwd
You'll get something back like:
/home/00000/users/.home/bin/drush
The drush command is at the end of that path, and you have to let the server know that now. Note that everything before bin can be replaced with ~/.
10. Switch back to your FTP client and root around in your server for the "home" folder. It's going to be back toward the root:
cd ~/users
11. You may or may not see a file named .bash_profile. Note: It might be hidden depending on your FTP client. If you are sure that it's not there, create a file and give it that name.
12. (mt) runs PHP4 on the command line by default. You have to specifically tell it to run Drush with PHP5. Thus, paste this into the file you just created (.bash_profile).
export DRUSHINI="/home/00000/users/.home/bin/drush/drush.ini"
alias drush='/usr/bin/php5 -c $DRUSHINI ~/bin/drush/drush.php'
13. Source .bash_profile to reload the .bash_profile file.
14. If successful, when you type in drush at this point you are going to get a long list of newly available commands.
Additional information
See also: (gs):Allow multiple open basedir directories.
Resources
Bash Script to install Drush https://gist.github.com/394177
Open_basedir restriction in effect: http://drupal.stackexchange.com/questions/10372/drush-open-basedir-error/10373#10373