I am sure I am missing something basic here, but I cannot seem to get Drush to run on a newly created Linode vps running an Ubuntu 8.10 LAMP server with a freshly installed Drupal 6.9 (installed using cvs). After also installing Drush via cvs, I enabled all the Drush specific modules (excepting the 'simpletest' which I have not installed) and created the link as well as an alias as described in the docs, but when i run 'drush' at the command prompt, the result is '/usr/bin/env: php: No such file or directory'. If I navigate to the drush directory and attempt to run the cmd, I am still left with '/usr/bin/env: php: No such file or directory'.
I also tried logging out and back in... but issue remains.

Thanks

Comments

greggles’s picture

This sounds like php is not in your $PATH variable. Try running "which php". You should get something like /usr/bin/php as the single response. If you get no data but only a new command prompt then that's an indication of an environment problem.

domesticat’s picture

Hmm. I'm seeing something similar, I think. Installed via CVS. Created the required hard link. If I navigate to the directory and run ./drush.php drush works properly. If I navigate back to the web root and try to execute drush, here's what happens:

calufrax:/var/www/domesticat.net# drush

Warning: require_once(/usr/bin/includes/environment.inc): failed to open stream: No such file or directory in /usr/bin/drush on line 17

Fatal error: require_once(): Failed opening required '/usr/bin/includes/environment.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/drush on line 17

which php returns /usr/bin/php

kpm’s picture

Ok, it looks like it is not in the path, when I run which php, nothing is returned. But I don't have any php files in /bin/... which is strange, it seems everyone else does... "whereis php" returns three directories /etc/php5, /usr/lib/php5, and /usr/share/php5 but If I attempt to run the drush.php from any of those directories, it still won't run.

Can anyone let me know how to get php into the system path? I know how to do it on Windows, but not Linux.

Thanks

kpm’s picture

I saw another post with the same problem I was having: http://drupal.org/node/328988
So I ran "apt-get install php5-cgi" then created the link, "ln /usr/bin/php5-cgi /usr/bin/php" and now drush.php runs, but the result is:
"drush.php is designed to run via the command line.Segmentation fault"
Not sure if I fixed something or broke something now...

kpm’s picture

Status: Active » Closed (fixed)

Ok, sorted it out... I was missing the php5-cli application. sigh.

jayb1’s picture

Thanks I was stuck on this issue for a few hours until I ran across this post...

quickcel’s picture

Thanks - I was missing the php5-cli as well on my VPS...saved me a lot of time ;)

flashy’s picture

I am having the same issue - can someone please expand on how this was fixed? I am a semi newbie - php5-cli?

quickcel’s picture

If you are having the same problem, then you can run:

sudo apt-get install php5-cli

This will install the php5-cli package, and hopefully fix your problem