Installing Drush On Dreamhost
on
Installing Drush On Dreamhost
Outside of CivicActions I host some sites for friends and family on Dreamhost. I've always had a decent experience with DH for the kinds of sites I am talking about, especially for the price. Today I decided to get Drush installed. The first thing I did was ask on the drupal-seattle IRC channel if anyone had done it. Thinkling (Maarten) directed me to this post on Drupal.org.
It is pretty straight forward, but I figured I would spell it out with a little bit more information.
So here are the steps you must take:
SSH in to your dreamhost account
$ wget http://ftp.drupal.org/files/projects/drush-All-Versions-2.1.tar.gz
$ tar -xzf drush-All-Versions-2.1.tar.gz
$ mv drush drush_2.1
$ alias drush='/full/pathto/drush_2.1/drush'
$ pico .bash_profile Then add the following two lines to the end of your .bash_profile
export PATH=/usr/local/php5/bin/:$PATH
alias drush='/full/pathto/drush_2.1/drush'
Save your file.
This presumes that drush_2.1 lives in your user root directory, you would have to change the path if it lived elsewhere. Your full path will look something like:
"/home/username/drush_2.1/drush".
Here is the step that will save you a little bit of headache and worry:
LOGOUT. Terminate your SSH connection. And then log back in. OR you can run $ source .bash_profile You can then type drush at the command line and it will work (give you a list of commands). Of course you will want to run it from your drupal root.
Check out Owen's blog post for more information and a video tutorial of Drush.
UPDATE:
It is worth noting, the reason to rename the drush directory something else is because you cannot have a symlink with the same name as the directory, that said, if you are not creating a symlink, and just using the alias route, it seems you do not need to rename the directory. This would make updating drush easier because you will not have to update the alias in the your .bash_profile. Also, you could put the entire drush directory in some other directory within your root. For example you could create a directory "drupal_tools" or some such.
First off, thanks so much for sharing these instructions - they helped me get most of the way there - but now I'm stumped. When I submit the "drush" command, I'm given the list of examples, options, and commands so I feel as though I'm close. However, when I submit the command "drush status" I get the following warning and error:
WARNING:
parse_url(mysql://db...): Unable to parse URL
ERROR:
Fatal error: Unsupported operand types in .../drush_2.1/includes/environment.inc on line 603
Drush command could not be completed.
I've been searching these errors with very little success. Any guidance you could provide would be greatly appreciated.
Many thanks!













My first question is: is your drupal website up and running properly?
Second question: are you running drush from your drupal root, or in the case of multi site install, from the directory for one of your sites in drupal_root/sites/sitename.com where sitename.com is the name of your site?
Third question: could there be some issue with your db uri in settings.php?
Forth question: did you try any other drush commands, perhaps try something innocuous like "drush watchdog show" which will how you the watchdog table entries. You might also try a "drush dl" for a module or a "drush cron" to run your cron job.