Asa2_Cron_Ratings produces parse error: syntax error, unexpected '{'

Problem

The following error occurs when executing an ASA2 cronjob:

Solution

This is probably because you are running the cronjob with an outdated PHP version which does not support the code in the cronjob script. You need at least PHP version 5, better version 7.

With some webhosters the standard command “php” executes an outdated version and there is a special command for each version, e.g. “php5” or “php7“. Which version the command “php” uses, you can see by executing “php -v“. If this results in a version less than 5.3, please ask your webhoster how you can run PHP scripts on the shell with a current version.

For example, if there is a “php56” command on your server that allows you to run PHP version 5.6 on the shell, you can tell the ASA2 cronjob that it should use this command with the “php” option, like this: