PHP Parse Error with Database Enrollment Plugin

PHP Parse Error with Database Enrollment Plugin

by John Wickenhaeuser -
Number of replies: 1

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.


Average of ratings: -
In reply to John Wickenhaeuser

Re: PHP Parse Error with Database Enrollment Plugin

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Remember that the web-based and command line installations of PHP are completely different. Upgrading one (depending how you do it) may not upgrade the other. At the very least, you cannot take it for granted. 

Average of ratings: Useful (1)