Drush Cron on Dreamhost

Submitted by Darren Oh on Mon, 02/08/2016 - 10:19

I set up Dreamhost cron jobs to run drush cron for two different sites running Drupal 8.0.3. One of the cron jobs worked, but the other failed with a syntax error. Drupal 8 requires PHP 5.5.9 or later, and the default version of PHP for one of the sites was 5.4.42. Changing the default PHP version in .bash_profile and .bashrc did not fix the error. I finally learned that cron jobs on Dreamhost run in the sh shell, not the bash shell. drush cron would not work. It was necessary to run drush as php drush.php. (The actual cron jobs use full paths.)