2

I've twice followed these instructions to install Drush 8. At the end of the process I can run Drush anywhere and it responds as expected.

However, whenever my server connection is broken and I log back into the server, Drush no longer responds.

Can anyone point out why that is happening?

MORE DETIALS:

I honestly don't know what the issue is. I get the following message each time I go through the process of reinstalling Drush:

sisko@localhost:~/bin/drush-master$ drush
No command 'drush' found, did you mean:
 Command 'rush' from package 'rush' (universe)
drush: command not found

I tried another tutorial attempting to install it manually with no success - just the message I pasted above.

I tried running sudo apt-get install drush and it was not found.

If it helps, I am running PHP 7.0.22 on ubuntu 17.04 as shown in the following (and I'm trying to install drush for a Drupal 7 site):

sisko@localhost:~/bin/drush-master$ php -v
PHP 7.0.22-0ubuntu0.17.04.1 (cli) (built: Aug  8 2017 22:03:30) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.22-0ubuntu0.17.04.1, Copyright (c) 1999-2017, by Zend Technologies

The server shell:

sisko@localhost: echo $SHELL
/bin/bash

UPDATE: I am still experiencing the persistent loss of the Drush command on my server each time the ssh connection drops. I then have to re-introduce the Drush command by following these steps as detailed by @Sarika:

echo $PATH ---> confirms Drush is **NOT** included in the path
export PATH="$HOME/.composer/vendor/bin:$PATH"
source ~/.bashrc
sudo composer global require drush/drush:8.*
1
  • I do not think there is any information to answer this question as it is too broad. Please provide more details, a specific qusetion, an error message, version of Drupal you're using Drupal 8 on, etc...
    – mradcliffe
    Oct 6, 2017 at 16:38

2 Answers 2

1

Did you get drush installed on your system? Check it with the following command.

drush --version

If it is a lower version please update drush using composer, if composer already installed skip the step to install composer.

cd ~
curl -sS https://getcomposer.org/installer | php
export PATH="$HOME/.composer/vendor/bin:$PATH"
source ~/.bashrc
composer global require drush/drush:8.*
drush --version
0

Looking at the instructions you used and the problem you describe, the issue is most likely that you are loosing the changes you have done to your PATH shell variable. You have to check which configuration files is loaded when you login and add the export PATH line to that file.

To verify that the path is missing the .composer/vendor/bin path, do echo $PATH.

4
  • Thanks. composer is definitely missing from $PATH. What I don't know is how to keep it there each time I log back into the server
    – sisko
    Oct 4, 2017 at 10:26
  • First verify which shell you are actually using with echo $SHELL. Did you actually add the export PATH line to one of the shell config files? If you did it in .bash_profile try one of the others - .profile or directly in .bashrc or ... Please accept my answer ;-)
    – hansfn
    Oct 4, 2017 at 11:01
  • I found /bin/bash is the shell I'm using but I'm not sure how to factor that into installing Drush
    – sisko
    Oct 7, 2017 at 22:12
  • And what about the rest of my comment? Did you try / check what I suggested?
    – hansfn
    Oct 8, 2017 at 12:09

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