I'm running Drupal 7.67 on PHP 7.1 and am now getting the below error when I invoke Drush commands.

Another gripe is that upon install, Civi blew out my blocks settings, so I needed to reconstruct the site from a window I (thankfully) already had open.

I've not run into either of these issues before. Any suggestions greatly appreciated... thanks!

Warning: Unsupported declare 'strict_types' in /[site]/sites/all/modules/civicrm/vendor/league/csv/src/functions.php on line 12

Parse error: syntax error, unexpected ':', expecting '{' in /[site]/sites/all/modules/civicrm/vendor/league/csv/src/functions.php on line 33 Drush command terminated abnormally due to an unrecoverable error. [error] Error: syntax error, unexpected ':', expecting '{' in /[site]/sites/all/modules/civicrm/vendor/league/csv/src/functions.php, line 33

2 Answers 2


You will need to upgrade php version to 7.x. also check your apache/nginx and cli are using 7.x version of php

See https://docs.civicrm.org/sysadmin/en/latest/requirements/#php-version

  • 1
    Agreed with Pradeep here - it sounds like you're using a different version of PHP on the command line. Commented Aug 19, 2019 at 16:47
  • Nope. I did mention that I'm running PHP 7.1 PHP Version 7.1.31, to be precise. 7.2 crashes the site for reasons I probably won't investigate until I have to.
    – Billyjames
    Commented Aug 21, 2019 at 13:05

UPDATE: found the answer

long ago, someone had added alias drush='/usr/bin/php5 /usr/local/bin/drush' to /etc/bash.bashrc I commented that out and all works as expected

I hit this same issue recently.

debian OS, php 7.1 on command line and in apache; same modules enabled; same configuration; can't see any differences between phpinfo() via apache and php -i on command line.

in apache, no errors. When I try to run drush I get the error reported above.

My temp fix is that since I also have php 7.2 installed on the server is to force drush to run with 7.2 -- this works for now. for example: /usr/bin/php7.2 /usr/local/bin/drush cc all

I've been unable to find the source of the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.