Our hosting platform allows you the flexibility of running your website on various PHP versions, you can even use different PHP versions for different websites on the single server.
Servers can only have one default PHP versions and this is the version used if you run a php ... command via SSH. As scheduled tasks (CRON) send commands to be run on the server, if you start the command php ... then it will run as the default PHP version and not that which the website is set to use in the hosting platform. See example below:
To run this task using the same PHP version as the website (PHP 7.1 in this example), you have to use the full path to the PHP executable. See below:
All relevant PHP executable paths are listed below:
/usr/bin/php8.1
/usr/bin/php8.0
/usr/bin/php7.4
/usr/bin/php7.3
/usr/bin/php7.2
/usr/bin/php7.1
/usr/bin/php7.0
/usr/bin/php5.6