Hi All,

After much jiggery-pokery, I got Drush working. I have enough Terminal experience to be dangerous, but not enough to know what I'm doing. I thought I'd write a quick synopsis of what worked for me, in the hope that it might be beneficial to others in my stage of learning. This is by no means the way it should be done, but might shed some light for others.

Le steps:

1. Download drush and put it in the root of your site
2. unpack it: tar xvzf drush....
3. make Drush executable: chmod u+x drush/drush (or chmod u+x /path/to/drush, wherever you have it placed)

Now that Drush is unpacked and ready to use, you need to create a link to it (an alias) so that you can use drush commands in any subfolder. The root folder of your website will contain hidden files: .profile, .bashrc, .bash_aliases etc...this is where the alias goes. I put mine in .bashrc. Nano, the text editor will help.

4. nano .bashrc
5. under the rest of the aliases in .bashrc, add in: alias drush='/path/to/drush/drush' -- my path happened to be /users/home/saltcod
6. Hit Ctrl+X to save and exit
7. Now you can use Drush from any subfolder

Again, this is certainly not a best practice guide - just an attempted helping hand for others who aren't well versed in Terminal lingo. If you have any questions just ask - asking might spur others to get under the hood with the Terminal and drush.

Comments

saltcod’s picture

An extra step as per this thread: http://drupal.org/node/649736

run: source ~/.bashrc

To make the alias work.

hat tip to @rovr138

decibel.places’s picture

I have shared hosting at Hot Drupal with SSH access. I have a couple of sites in subdirectories of my HTML root.

This is what worked for me.

I could not install Drush to /usr/bin/lib so I put it in my home directory

Then with PuTTY I navigated to the subdirectory where I want to use Drush. I created an alias with alias drush="~/whereyouputdrush/drush" where the ~/ is my home directory.

then I was able to use right there eg myusername@mydomain.com [~/public_html/meier]# drush help

bmango’s picture

I'm logging in using putty to my webserver, but my console is using php4 (my webfiles though are using php5 as I have updated the .htaccess file). How can I make the console or the drush commands use php5?

bmango’s picture

decibel.places’s picture

previously I discussed installing and running drush, but trying to get it to do anything was still a problem, because my host has jailshell

here's what works:

  • in settings.php, if your db url is 'localhost' change it to '127.0.0.1'

eg change $db_url = 'mysql://username:password@localhost/databasename';
to $db_url = 'mysql://username:password@127.0.0.1/databasename';

some other advice, not specific to jailshell:

  • you may get an error that drush cannot set the php.ini to 300 for php max_execution_time

a. if you have the drupal_tweaks module, turn off the php tweaks - or disable the entire module
b. add ini_set('max_execution-time', '300'); where the other ini_set lines are in settings.php

another quirk I encountered:

  • error something like "cannot connect with user <em>0</em>'

- check if you actually have a user with uid 0 in your users table (one of my sites didn't)

saltcod’s picture

Still one more followup.

On my Mac, I need to put the alias in ~/.bash_profile for it to work everytime I open a new terminal window.