I tried to follow solution here: Why does drush say "command not found" when I try to execute remote commands?

But it did not work for me, the url /usr/local/zend/bin does not exists in my hosting provider.

I can't run any remote command from my local, I dould test the connection doing

drush @remote ssh

and it correctly connects through ssh, so the problem is not in the connection. Please help me with this =( Thanks

1 Answer 1


The other question that you reference answers your question perfectly, except for the fact that Drush is located in a different location on that user's remote system. Since drush @remote ssh works for you, type which drush on the remote system, to find out where your Drush is located. You are likely to get an answer similar to /home/USER/.composer/vendor/bin/drush. You need to insure that the directory /home/USER/.composer/vendor/bin is in your PATH. This directory might vary if you did not install Drush using Composer, as recommended in the Drush README.

If which drush produces no output at all, this means that you forgot to install Drush on the remote machine. Use composer, following the same instructions you would for your local machine, in the above-referenced README file.

Pay particular attention to the following part of the installation instructions:

Add Composer's global bin directory to the system PATH (recommended):

sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
source $HOME/.bashrc

The 'sed' line shown above adds an export PATH statement to the TOP of your .bashrc file. It is important to set your PATH early, because .bashrc exits just a few lines in when running in non-interactive mode on most Linux distributions. Most of the other places you might be tempted to set the PATH (.profile, etc.) are not sourced at all in non-interactive mode. So, if you do not set the PATH in the right place, then Drush will work from an interactive shell (e.g. after drush @remote ssh), but most remote Drush commands (e.g. drush @remote status) will not.

  • Ok I did "which drush" in my remote serve, and this was the path "/chroot/drush/drush" Drush was installed by default when I bought my hosting. So I added this to my alias in my aliases.drushrc.php file: 'path-aliases' => array( '%drush-script' => '/chroot/drush/drush', ) but I got this error when ran again "drush @remote status" Error in argument 1, char 2: option not found r /chroot/drush/drush: line 125: [: too many arguments Content-type: text/html
    – svelandiag
    Commented Nov 30, 2014 at 3:22
  • 1
    The smartest thing would probably be to open a support ticket with your provider, since they installed Drush. :) The error message you are getting sort of looks like Drush is not being executed by bash. Commented Nov 30, 2014 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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