2

We have been successfully using Drush, latest version 6.3.0. In order to obtain Drupal 8 support, I am trying to upgrade to Drush 8.0.5.

First I located the 8.0.5.tar.gz file and tried getting success that way. It complains:

./drupal-cron.php.sh 

20160407-204933 drush core-cron cron.php begin Unable to load autoload.php. Run composer install to fetch dependencies and write this file (http://docs.drush.org/en/master/install-alternative/). Or if you prefer, use the drush.phar which already has depdencies included (http://docs.drush.org/en/master/install). X-Powered-By: PHP/5.4.45 Content-type: text/html

So next I tried pulling down drush.phar as that appeared to have the dependencies built-in. Trying that version also did not seem to successfully execute Drupal cron:

./drupal-cron.php.sh 

20160407-211633 drush core-cron cron.php begin
X-Powered-By: PHP/5.4.45
Content-type: text/html

We have been successfully running Drupal cron with Drush since our last update back in 2014 with this script:

#!/bin/bash
DATE=`/bin/date +%Y%m%d`
DATETIME=`/bin/date +%Y%m%d-%H%M%S`
LOGFILE=/kunden/homepages/35/d157794216/htdocs/reports/$DATE.${2}.drupal-cron.php.sh.log
export COLUMNS=132

echo $DATETIME drush core-cron cron.php begin | /usr/bin/tee -a $LOGFILE
/usr/bin/nice -n19 /usr/local/bin/php5.4 /kunden/homepages/35/d157794216/htdocs/drush/drush.php --root=$1 --uri=http://$2 --debug --nocolor core-cron 2>&1 | /usr/bin/tee -a $LOGFILE

And to try drush.phar I swapped out drush.phar for drush.php in the Bash script.

Suggestions how to get successfully upgrade to the latest version?

  • As a side note, Drupal 8 requires PHP 5.5.9, at least. That is the version required by the Symfony components it uses. – kiamlaluno Apr 8 '16 at 3:24
1

It's not clear from your post how you are calling the phar, but you cannot call drush.php directly when using that variant. This technique (php drush.php) was recommended in Drush 3, but has been deprecated since Drush 4. The script you show above will work for calling cron, but will fail for commands that cause Drush to call itself.

If you want to use the .phar, make sure that the correct version of php is in your $PATH, and then call Drush directly.

Alternately, you could install composer and run composer install in the Drush directory after installing the .tar.gz file, or cloning from git. If you do this, set the DRUSH_PHP environment variable to point at the php executable that you would like to use, and call the drush script (not drush.php).

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.