-1

I'm trying to get Drush to work in a shared environment where I have limited SSH access. I've managed to install Composer and Drush. In PuTTY I can use Drush outside of my Drupal root folder, ie. /var/www/domain.com

Here I can successfully execute: vendor/bin/drush help and get the help output in return.

However, if I move (in PuTTY) to my web root folder where my Drupal installation is located: /var/www/domain.com/public_html and try to execute ../vendor/bin/drush help I get the following message: : No such file or directory

What am I doing wrong?

  • What is the absolute path for vendor/bin/drush, and the absolute path for the Drupal root folder? – kiamlaluno May 30 '17 at 15:16
  • absolute path for vendor/bin/drush: /var/www/sasclan.org/vendor/bin/drush which is a symlink to /var/www/sasclan.org/vender/drush/drush/drush absolute path for the Drupal root folder: /var/www/sasclan.org/public_html – hjorslev May 30 '17 at 15:26
0

Ideally, you should be able to just run drush help by itself without having to specify a path to it. If you can't do that, then maybe your environment isn't getting paths set correctly. Something missing from .bashrc or .profile maybe?

If paths / environment is a problem, I'd try using the phar version of drush - it's a self contained single file, and might work better. You can just download it and run it from anywhere. There's nothing to install:

cd ~
wget https://github.com/drush-ops/drush/releases/download/8.1.11/drush.phar
chmod +x drush.phar
cd /var/www/sasclan.org/public_html
~/drush.phar help
  • Thank you for your reply. The drush.phar works when I'm in the /var/www/sasclan.org/ folder, but if I move to /var/www/sasclan.org/public_html it doesn't work. I've also placed, just for testing, the drush.phar in the public_html folder and tested these commands: php drush.phar help and php ../drush.phar help. (I need to use the prefix php in order to run them). php drush.phar help works fine if I'm in /var/www/sasclan.org/. If it should work by using php ../drush.phar help from the public_html folder it's probably my host where the issue is located. – hjorslev May 31 '17 at 13:35
-1

I had the same problem and using Drush Launcher helped me.

A small wrapper around Drush for your global $PATH.

WHY?

In order to avoid dependency issues, it is best to require Drush on a per-project basis via Composer (composer require drush/drush). This makes Drush available to your project by placing it at vendor/bin/drush.

However, it is inconvenient to type vendor/bin/drush in order to execute Drush commands. By installing the Drush Launcher globally on your local machine, you can simply type drush on the command line, and the launcher will find and execute the project specific version of Drush located in your project's vendor directory.

Your Answer

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

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