diff --git a/drush b/drush index a8c93c35d9e9707ab29c3ae12bc9a8f60b51d49b..17f6d2f011e22367d5f7c227e2d331bb6ce5550f 100755 --- a/drush +++ b/drush @@ -55,18 +55,22 @@ if [ -n "$DRUSH_PHP" ] ; then # Use the DRUSH_PHP environment variable if it is available. php="$DRUSH_PHP" else - # Default to using the php that we find on the PATH. - # We check for a command line (cli) version of php, and if found use that. - # Note that we need the full path to php here for Dreamhost, which behaves oddly. See http://drupal.org/node/662926 - php="$(which php-cli php 2>/dev/null | head -1)" - - if [ ! -x "$php" ]; then - echo "ERROR: can't find php."; exit 1 - fi - # On MSYSGIT, we need to use "php", not the full path to php if [ -n "$MINGW" ] ; then php="php" + else + # Default to using the php that we find on the PATH. + # We check for a command line (cli) version of php, and if found use that. + # Note that we need the full path to php here for Dreamhost, which behaves oddly. See http://drupal.org/node/662926 + php="`which php-cli 2>/dev/null`" + + if [ ! -x "$php" ]; then + php="`which php 2>/dev/null`" + fi + + if [ ! -x "$php" ]; then + echo "ERROR: can't find php."; exit 1 + fi fi fi