I had Drush 4. Then I deleted Drush folder and installed Drush 8 through Composer for my user. Now drush command works on a server for my user.

Then I try to invoke drush from my local computer it does not work:

drush @myalias status -v
Loaded alias @myalias from file /home/myuser/.drush/site-aliases/aliases.drushrc.php                                                                                                           [notice]
Begin redispatch via drush_invoke_process().                                                                                                                                                   [notice]
Calling proc_open(ssh myserver 'env COLUMNS=199 drush  --verbose --uri=my.site.com --root=/my/web/path  core-status 2>&1' 2>&1);
env: drush: No such file or directory
End redispatch via drush_invoke_process().

So I localized the problem - Drush does not work through SSH, but it works on the server under the same user.

ssh myalias 'drush'
bash: drush: command not found

I tried unsuccessfully: Add export PATH="$HOME/.composer/vendor/bin:$PATH" or PATH="~/.composer/vendor/bin:$PATH" to .bashrc and .bash_profile.

But it works: ssh myalias '~/.composer/vendor/bin/drush'

  • Drush 4 is totally unsuported , why do you use it? – sanzante Mar 11 '17 at 18:53
  • It is legacy. It is a reason why I want updating. – Artu Mar 11 '17 at 19:46
  • Try ssh myalias 'echo $PATH' to confirm that the path is still incorrect. Then check that you are modifying PATH in the correct files. And this isn't a Drush question - it's all about your shell. – hansfn Mar 13 '17 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.