I found (running Acquia Dev Desktop on OSX) that almost everything we took for granted in the shell was not available. This is how I got the result - when launched in the context of rules.module php eval ().
# When running from web, drush doesn't have any environment set up,
# has no search paths for site-aliases, and maybe can't even find PHP.
$php = "/Applications/acquia-drupal/php5_4/bin/php";
$drush_php = "/Users/dan/.composer/vendor/bin/drush.php";
$drush_options = " --config=/Users/dan/.drushrc.php ";
$command = "$php $drush_php $drush_options $site_alias status";
$result = exec($command, $output, $return);
drupal_set_message(print_r(array($command, $result, $output, $return), 1));
Obviously, adjust your paths if necessary. The full team ended as follows:
/Applications/acquia-drupal/php5_4/bin/php /Users/dan/.composer/vendor/bin/drush.php --config=/Users/dan/.drushrc.php @example.org.nz status
source
share