Cms: ./craft PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /vendor/ramsey/uuid/src/functions.php on line 34

Created on 14 May 2020  路  2Comments  路  Source: craftcms/cms

Description

I just tried running ./craft on a client server to remind myself how to re-save entries and got this message:

$ ./craft

PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /srv/users/sitename/apps/sitename/vendor/ramsey/uuid/src/functions.php on line 34

Apologies if this is completely unrelated to Craft, any idea if this is some kind of bug, or where I can ask for help?

Additional info

  • Craft version: 3.4.19.1
  • PHP version: Server: 7.3.17. . CLI: 7.0.33
  • Database driver & version: MySQL

Most helpful comment

If you add this to composer.json and then run composer update, your dependencies should all be downgraded to versions that are compatible with PHP 7.0:

"config": {
  "platform": {
    "php":  "7.0"
  }
}

All 2 comments

Billythekid on Discord just confirmed the issue is that the CLI is running PHP 7.0 and this needs 7.1. Sorted!

If you add this to composer.json and then run composer update, your dependencies should all be downgraded to versions that are compatible with PHP 7.0:

"config": {
  "platform": {
    "php":  "7.0"
  }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

timkelty picture timkelty  路  3Comments

brandonkelly picture brandonkelly  路  3Comments

lukebailey picture lukebailey  路  3Comments

bitboxfw picture bitboxfw  路  3Comments

rynpsc picture rynpsc  路  3Comments