3

When I run drush without sudo I get the header plus: drush is designed to run via the command line. Drush with sudo works as intended.

I have read that: You do not need root-level permissions to use Drush: it'll work as long as the user invoking it has direct access to the Drupal installation directory.

This does not seem to be true in this case. Even when I su to the exact user that owns the Drupal installation, I still cannot run Drush without the error message.

drwxr-xr-x 10 ouruser www-data     4096 May 18  2012 html

Is there something incorrect about permissions or is there another problem going on?

  • Depends. What is the error message you are getting? – greg_1_anderson Feb 8 '13 at 23:18
  • Error message is: drush is designed to run via the command line. Also I get a header, html/text. – edroms Feb 9 '13 at 3:37
  • 6
    Sounds like are using a different php with sudo than without. Check $PATH in both environments. You should be using php-cli with Drush; looks like you are using php-cgi without sudo. Fix your $PATH in the non-sudo environment so that the same php executable is selected as is in the sudo case. – greg_1_anderson Feb 9 '13 at 4:06
  • Yes, I found a symbolic link to php-cgi in usr/local/bin, the directory with the sym link to drush. Haven't had the time to correct yet, but this seems to be the culprit. Thanks very much, @greg_1_anderson – edroms Feb 10 '13 at 16:53
1

Greggles comment is most likely correct. Check your php path my going to the phpinfo path in the reports section. The URL is admin/reports/status/php.

0

As per Greg comment:

Sounds like are using a different PHP with sudo than without. Check $PATH in both environments. You should be using php-cli with Drush; looks like you are using php-cgi without sudo. Fix your $PATH in the non-sudo environment so that the same php executable is selected as is in the sudo case.

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.