Welcome! Your solution works ... for now ... but '... special request!!!!???? ....'
php-cli isn't the same as the php that is used for web service (assuming apache ... php-fpm).
Think you might need to re-think. Go to Site Admin -> Server -> Environment - update component ... then select higher versions of Moodle to see what you'll need
True RHEL vr 6,7, and probably 8 have always been 'conservative' when it comes to php versions provided by their repo. Thus a reputable 3 party repo needed to keep pace with PHP.
For php, remi repo and/or webtatic repo are pretty good. There are others.
So you've got a work-around in place right now ... not yet done (never is). And it's just for cron ... but, there are some useful CLI only scripts through out moodle code.
Those in moodlecode/admin/cli/ have been extremely useful.
Speaking of 'useful' .. please feel free to rate any of my responses as 'useful' ... it's a way of saying thanks + I 'earn a badge'!
'SoS', Ken