I am on a shared server and someone else has installed Drush previously. But as of now Drush does not work and throws the following error.

[root@vps1]# drush
/root/.composer/vendor/bin/drush: line 47: which: command not found
ERROR: can't find php.

The last thing I can remember was updating PHP (mod_php) to 5.4.36 several days ago. It worked on 5.4.34, but PHP was recompiled during the update. Is this related? What do I need to do to tell drush about this 'new' php?

  • It seems what you need is PHP-CLI (command line interface). Did you check if typing "php -v" works? – dinopmi Jan 26 '15 at 15:32
  • Well, I thought about that too. But it did not change the mode php runs in... I only updated it, so I guess that should not be it... Command line works if I type php -r 'echo "hi";' – Neograph734 Jan 26 '15 at 15:36
  • Php -v returns: PHP 5.4.36 (cli) (built: Dec 23 2014 18:36:53) - Copyright (c) 1997-2014 The PHP Group - Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies – Neograph734 Jan 26 '15 at 16:37

which: command not found

I don't really use Drush, but that looks like it's dying when it uses the "which" command to locate PHP... Drush is falsely reporting that PHP can't be found, but it's because the command it uses to look for it ("which") is not available.

| improve this answer | |
  • 1
    I read that too, but I can't quite figure where that comes from... – Neograph734 Jan 26 '15 at 16:24
  • 1
    Drush uses multiple which statements prior to line 47. So I doubt this is the problem. – Neograph734 Jan 26 '15 at 16:40
  • 1
    Ok, you were right. The system showed which as an installed package but the command did not work. yum reinstall which solved the issue. – Neograph734 Jan 26 '15 at 18:27

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.