Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to install drush-toolbox project globaly on my linux server box so all users can use it. How can I do it?

share|improve this question
up vote 6 down vote accepted

Put it in /usr/share/drush/commands for global accessibility. On Windows, Drush will look in the folder named Drush/share/drush/commands inside the location specified by the ALLUSERSPROFILE environment variable.

After adding new commands, you will need to run drush cc drush to clear the Drush command cache, so that Drush will once again scan its command searchpath.

share|improve this answer
    
Not works for today versions. – Bobík Nov 11 '15 at 9:28
    
/usr/share/drush/commands is still working fine with Drush 8; I just tested to confirm. Perhaps you did not clear your cache after adding new commands? I updated the answer to include this advice. – greg_1_anderson Nov 11 '15 at 14:51

You can also specify your own directory for Drush modules/commands by drushrc.php:

$options['include'] = array('/path/to/commands','/path2/to/more/commands');

This file could be placed in several directories:

  1. Drupal site folder (e.g. sites/{default|example.com}/drushrc.php).
  2. Drupal sites/all/drush folder.
  3. In any location, as specified by the --config (-c) option.
  4. User's .drush folder (i.e. ~/.drush/drushrc.php).
  5. System wide configuration folder (e.g. /etc/drush/drushrc.php).

More useful informations can be found in example.drushrc.php.

share|improve this answer

Newer versions of drush (6.2 here) are installed with composer, the new PHP dependency manager. So the installation of an additional command is now like this, in your case:

  1. Go to the installation directory for drush commands:

    cd [drupal-site-docroot]/vendor/drush/drush/commands
    

    This assumes the default case where composer installed drush for each of your Drupal sites separately (it can also install it once per user, or system-wide – I prefer the latter).

  2. Download, unpack and clean up:

    wget https://github.com/zroger/drush-toolbox/archive/master.zip;
    unzip master.zip;
    mv drush-toolbox-master drush-toolbox;
    rm master.zip;
    
  3. Clear the commandfile cache to register the new command:

    drush cc drush
    
share|improve this answer
    
This installs Drush command only for one site, not globally for all users. – Bobík Nov 9 '15 at 10:33
    
It is not advisable to manually place files inside the vendor directory, as composer will rewrite that location, e.g. on composer update. – greg_1_anderson Nov 11 '15 at 14:54

If you only need it for your local user on Linux, then put plugin into

~/.drush/commands
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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