1

I have a shared hosting account on which i have created sites using joomla 2.5 and drupal 7.

I want to use drush to apply patches to existing modules for my drupal 7 site.

Can any one guide me as to how can i install this drush and use it for these drupal 7 sites on my shared hosting ?

Step by Step Guide would be highly appreciated (New here)

Thanks

5

When I google "install drush on shared hosting", the two top hits are exactly what you are looking for.

  1. Learning How to Install Drush on a Non-Admin Rights Server
  2. Installing Drush on Shared Hosting Accounts
2

Update: There is a complete github project now https://github.com/theodorosploumis/drush-installer.

Assuming that you have ssh access to the server and no sudo permissions.

Also, there must be curl and zip installed. Otherwise you have to change the related commands according to your tools.

Drush now is installed through Composer so we need to install Composer before Drush.

# 1. Login to the server from your local machine with ssh
$ ssh USER@SERVER
$ cd ~

# 2. Use Bash as command line (if you like you can use your own CL too!)
$ chsh -s $(which bash) $USER

# 3. Install Composer
$ mkdir ~/bin
$ curl -sS https://getcomposer.org/installer | php -- --install-dir=bin

# 4. Download Drush files (we are in our home folder)

# 4.1 Git method (recommended). After this go to step 5
$ cd ~
$ git clone git@github.com/drush-ops/drush.git
$ cd drush
$ git checkout 6.x

# 4.2 Alternatively, if you don't have git, 
# download the files with wget. Currently stable version is 6.x
# Notice that you need Drush 7.x to be able to work with Drupal 8.x
$ wget https://github.com/drush-ops/drush/archive/6.x.zip

# Unzip it and rename the folder to /drush
$ unzip 6.x.zip
$ rm 6.x.zip
$ mv ~/drush-6.x ~/drush

# 5. Make the drush folder executable by current USER
$ chmod u+x ~/drush/drush

# 6. Install Drush from Composer
$ cd ~/drush
$ php ~/bin/composer.phar install

# 7. Add alias drush to .bash_profile
$ echo "alias drush='~/drush/drush'" > ~/.bash_profile

# 8. Source the changed .bash_profile or restart ssh session
$ source ~/.bash_profile

I have created 2 simple bash scripts for this task.

Not the answer you're looking for? Browse other questions tagged or ask your own question.