install moodle3.9: error cron.php

install moodle3.9: error cron.php

by Leonardo Cruz de Andrade -
Number of replies: 1
Esteemed,

I installed moodle 3.9 and am having problems with cron.php, reported as:

The admin / cli / cron.php must be run every 1 minute, and has never been run.

Used on php server 7.2 .... I tried to update to 7.3 and the problem persists .........

I receive an hourly email from the server reporting the following error in cron.php:

<br />
<b> Parse error </b>: syntax error, unexpected ':', expecting ';' or '{' in <b> /home1/leoand63/public_html/cursos/lib/classes/component.php </b> on line <b> 1110 </b> <br />

Does anyone have any suggestions to resolve?

Thank you and I look forward to it.
Average of ratings: -
In reply to Leonardo Cruz de Andrade

Re: install moodle3.9: error cron.php

by Ken Task -
Picture of Particularly helpful Moodlers

The cron to run is in code/admin/cli/cron.php.  That requires php-cli (command line php).  So the path in the set up of the cron job ... something like /usr/bin/php ... isn't the php-cli needed.

From ssh logged onto server as root, what does:

which php [ENTER] show?

Use the full path you see above with the -v switch:

/fullpath/php -v

If that does not return PHP 7.3.x (cli) you need to find the correct path to the cli of php.

Fun and games search:

find / -name php [ENTER]

You are looking for path that shows php73 in it and ends with /bin/php

Example ... not real ... if find found a path like this:

/opt/eapp/php73/bin/php

Then full path for cron.php would be:

/opt/eapp/php73/bin/php /path/to/moodle/admin/cli/cron.php

'SoS', Ken

Average of ratings: Useful (1)