After upgrading to php 7.1 from 5.6 which worked fine and seemed to have no issues, I then tried to run the
/enrol/database/cli/sync.php -v command for the database enrollment script. It failed with the following error:
PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /var/www/moodle2019s1/lib/classes/component.php on line 1265
I had to completely remove php5.6 from the server because this particular script was seeing it and failing. PHP5.6 was not enabled in apache2, it did not report in php -v or when you create a file with
<?php phpinfo();?> in it. So this is odd and I would hazard a guess an issue with the database/cli/sync.php file.
Hope this helps someone else.