4

Refering to https://www.drupal.org/node/2132447, I would like to install Drush in /usr/slocal/abc directory, and I tried the following steps:

$ cd /usr/slocal/abc $ wget --quiet -O - http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz $ tar -zxf drush-7.x-5.9.tar.gz $ ln -s /usr/slocal/abc/drush/drush /usr/local/bin/drush 

Then, I got this error:

ln: creating symbolic link '/usr/local/bin/drush': Permission denied

I asked my system admin who said that the company policy does not allow to install stuff into /usr/local/bin.

I've searched many installation guides, all of them requires to create a symbolic link '/usr/local/bin/drush' in order to run Drush. Is there any other way I can do it?

2
  • What Linux OS are you running? Commented Nov 28, 2014 at 6:36
  • CentOS release 6.3 (Final) Commented Nov 28, 2014 at 7:21

2 Answers 2

3

This may not answer the question directly, but a preferred and much simpler way to install Drush, is to install it through the Composer.

Installing Composer

See Composer's website for greater detail.

curl -sS https://getcomposer.org/installer | php # If the above code fails, use this one. # php -r "readfile('https://getcomposer.org/installer');" | php sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc source $HOME/.bashrc 

Installing Drush

See Drush instructions on GitHub for greater detail.

To install Drush 6:

composer global require drush/drush:6.* 

Or to install Drush 7:

composer global require drush/drush:dev-master 

Update

Per @leekit, he was able to solve his original issue by substituting the symbolic link with export PATH="$PATH:/path/to/drush:/usr/local/bin". For that and other alternatives, refer to step 3 of Install - Manual, on Drush instructions on GitHub.

4
  • 2
    Thanks for your suggestion. Finally, refer to github.com/drush-ops/…, I tried using $PATH to configure my system to recognize where Drush resides: export PATH="$PATH:/usr/slocal/abc/drush, then run source .bashrc. It works now! Commented Nov 28, 2014 at 7:30
  • You're right. That would be an alternative for a symbolic link. Commented Nov 28, 2014 at 7:45
  • What exactly is usr/slocal? Is it a custom bin dir per user? Commented Nov 28, 2014 at 7:55
  • @murraybiscuit Since it is /usr/slocal, it is not a user directory; it is a directory inside the root directory of the boot disk. Commented Nov 28, 2014 at 10:55
1

Another option is to install Drush with Homebrew which is the route I usually go down. https://www.drupal.org/node/954766

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.