Configuring Drush

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
trista13's picture

I finally got a Virtualbox set up (so easy using Qickstart!! Thanks Scott!). Now, I'm working on getting Drush up and running. Quickstart has it all configured for my local site, but I'm trying to get it going on my hosted site. I downloaded and unzipped the drush tar ball in my home/username folder. I'm now trying to create an alias to get it going and seem to be stuck. I tried using these instructions: http://knol.google.com/k/how-to-install-drupal-with-drush#
So I typed this in the command line while in my home/username folder: echo "alias drush='php ~/drush/drush.php'" >> ~/.bash_profile
That seemed to do nothing. I also used this older tutorial: http://civicactions.com/blog/2009/jun/10/drush_20_released_screencast_1_...
With that one, I typed in nano ~/.bash_profile
I then typed in alias drush='home/bitterr2/drush/drush' but, I couldn't even figure out how to get it to process my command (this seemed to put me in a different program with different commands).
I also just followed the Readme file (http://drupalcode.org/project/drush.git/blob/HEAD:/README.txt), but that also seemed to not go anywhere (actually started with the Readme and then worked my way through the other two).

So, is there anyone that can give me a simple explanation of how to get drush going on my hosted site? (Scott, you may have gone over this at the last meet-up, but that was two days after my surgery and boy was I out of it! But, my arm is straight!)

Thanks for all your help!

Comments

Tough

scottrouse's picture

Drush on shared hosting always seems to be a challenge. So, I'm assuming you've done these steps:

  1. Downloaded the Drush tarball and expanded it in your home folder:
    cd ~
    wget http://ftp.drupal.org/files/projects/drush-7.x-4.4.tar.gz
    tar -zxvf drush-7.x-4.4.tar.gz
    rm drush-7.x-4.4.tar.gz
  2. Made the "drush" command executable:
    chmod u+x ~/drush/drush

Now, if you type drush st, you see something like drush: command not found? If that's the case, let's test and make sure the drush command is executable. Type ~/drush/drush. See if that gives you some drush-looking output (you'll know when you see it). If so, we just need to create a shortcut to the drush executable, so we can call it with the drush command.

Type ln -s ~/drush/drush /usr/local/bin/drush. Now try typing drush and see if you get the same drush-like output. If not, let me know, and we'll troubleshoot deeper.

-Scott

File does not exist

trista13's picture

So, I made sure that the file called drush in my folder called drush is executable and it is. I also typed in the command line ~/drush/drush and I got a list of drush commands (so, I think that's a good thing). But, when I try to make the link, it says this:

bitterr2@bitterrootpubliclibrary.org [~]# ln -s ~/drush/drush /usr/local/bin/drush
ln: creating symbolic link /usr/local/bin/drush' to/home6/bitterr2/drush/drush': No such file or directory

Is the first string supposed to have a file path specific to my website or was I correct in copying and pasting it?

Thanks for your help :)

Shared Hosting Trouble

scottrouse's picture

The trouble sometimes comes with not being able to create the appropriate symlink on shared hosting and/or not knowing exactly where to link things in these shared environments. I'll give another suggestion to try, but, if it fails, you can always call drush the difficult way: ~/drush/drush [your command here] rather than drush [your command here]. :-)

Try typing ln -s /home6/bitterr2/drush/drush /home6/bitterr2/bin/drush. Then test it by typing drush help. Let me know if you get another error message.

-Scott

Escalator becomes stairs

trista13's picture

Oh! Well, I will try this in a bit, but I thought drush wouldn't work at all. I think I can stand to type drush twice! :-)

Thanks for the help and the ability to get this far!

You bet

scottrouse's picture

You're very welcome. Best of luck.

Drush will work, but you may run into permission problems, still. Getting the alias working doesn't resolve that, however.

-Scott

Same message: No such file or

trista13's picture

Same message: No such file or directory.

Oh, and I just double checked

trista13's picture

Oh, and I just double checked my Quickstart and there is a file called drush in that folder (usr/local/bin). Strange... everything looks like it should be working.

Quickstart

scottrouse's picture

Things will be a bit different on Quickstart since it's essentially a private server that you have full control over. Shared hosting is much different. I've moved almost all of my sites to Virtual Private Server configurations to give me more flexibility with how I configure them (in exchange for much more maintenance and responsibility for security/stability on my part, unfortunately).

Even if you can't create

laken's picture

Even if you can't create symlinks on your server, since you have shell access you should be able to create aliases, and adding them to .bash_profile is the way to go. After placing the alias line in that file, you need to log out and log back in for the aliases to take effect.

Oh! I tried to create an

trista13's picture

Oh! I tried to create an alias in the second tutorial above but couldn't get it to work. But, I was trying through the command line and getting all confused. I'll have to try again by adding the line to the file. That makes sense!
Thanks Andy! (and congratulations are in order, right! You're a married man now!! <3)

I tried putting the alias

trista13's picture

I tried putting the alias into the bash_profile file and it looked like there was already an alias in there, put the path didn't seem quite right, so I added another one. It's very strange because I keep getting the error that the file/directory doesn't exist, but I can see it in my home folder... I think next week, I will delete all I've done and try starting fresh! Thanks again for all your help :)

Here's the error and the list of files showing there is a drush file in there (I have it in the home folder and I also copied it into a folder called "bin" because that seemed to be what it was looking for)
bitterr2@bitterrootpubliclibrary.org [~]# ls
./ .cpanel/ .lesshst
../ .cpanel-datastore/ mail/
access-logs@ cpbackup-exclude.conf .mozilla/
BackupNow/ .dns public_ftp/
.bash_history drupal-7.0/ public_html/
.bash_logout drush/ tmp/
.bash_profile drush-7.x-4.4.tar.gz .trash/
.bash_profile.save .emacs .viminfo
.bash_profile.save.1 etc/ webalizer.conf
.bashrc .gemrc www@
bin/ .htpasswds/ .zshrc
.contactemail .lastlogin
bitterr2@bitterrootpubliclibrary.org [~]# cd bin
bitterr2@bitterrootpubliclibrary.org [~/bin]# ls
./ docs/ drush.info examples/ README.txt
../ drush* drush_logo-black.png includes/
commands/ drush.bat drush.php* LICENSE.txt
bitterr2@bitterrootpubliclibrary.org [~/bin]# cd
bitterr2@bitterrootpubliclibrary.org [~]# drush
-bash: home/bitterr2/bin/drush/drush: No such file or directory
bitterr2@bitterrootpubliclibrary.org [~]#

Expanded incorrectly

scottrouse's picture

You expanded the contents of the drush tarball into the bin directory incorrectly. It should be bin/drush/[contents of drush folder], but you have bin/[contents of drush folder]. It's a bit misleading because you'll see drush/drush in all of the instructions. The first drush is the drush folder (directory) and the second drush is the drush "application" (script). Try putting the drush stuff (all of it) into a drush directory in bin/.

Western Montana

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: