I want to Install cron with putty SSH. I use php bin/magento cron:install [--force]
and get this error:
PHP Parse error: syntax error, unexpected '?', expecting variable
(T_VARIABLE) in
/www/htdocs/xxx/xxx/xxx/vendor/magento/framework/Filesystem/Directory/Write.php
on line 35
Server run with PHP Version 7.2.11-nmm1. What can I do? Where I can begin to search for it?
Best Answer
It seems your php version does not parse correctly Nullable types (such as that
?PathValidatorInterface
), which were introduced in php7.1 http://php.net/manual/en/migration71.new-features.phpDouble check your php version in command line, as it does not seem to be 7.2
It is not rare to have more than 1 php version installed, for instance https://stackoverflow.com/a/50591861/1073040