Error CRON

Error CRON

by Riccardo Fantoni -
Number of replies: 5

Good morning,

after completing the installation of release 3.7 the CRON doesn't work. The error returned to me is shown in the attachment.

Could you give me directions on how to solve? Thank you very much

Attachment 2780374
Average of ratings: -
In reply to Riccardo Fantoni

Re: Error CRON

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This is usually caused by having the wrong version of PHP (command line version). What happens if you type

php -v

on the command line? Moodle 3.7 has a minimum requirement of PHP 7.1
In reply to Howard Miller

Re: Error CRON

by Riccardo Fantoni -

The version of php is 7.1. We tried to change on 7.2 but we didn't resolved. We changed this line: 

config.php
$CFG->doclang = 'en' ;
we no longer have the error message from Cron, but the script and the planned processing don't start.
Thanks for your answer
In reply to Riccardo Fantoni

Re: Error CRON

by Ken Task -
Picture of Particularly helpful Moodlers

Don't have answer ... question though ...

See in the image a .php-cron-starter.

what's .php-cron-starter?
and what does it contain?

And a check ... is cli php finding php-cli?

which php shows path

/full/path/shown/above/php -v

should show (cli) in response.

'SoS', Ken


In reply to Ken Task

Re: Error CRON

by Riccardo Fantoni -
I don't understand, sorry.
In reply to Riccardo Fantoni

Re: Error CRON

by Ken Task -
Picture of Particularly helpful Moodlers

In your screen shot:

the 'sudo -u web' ... line ... there is a .php-cron-starter shown.

What is .php-cron-starter? A 'dot' at the beginning of that indicates it's a hidden file? or directory?

And at the very end of screen shot it shows
web7_corsi_cron.sh is what failed.
So what is contained in web7_corsi_cron.sh script?

Howard suggested usually caused by having the wrong version of PHP (command line version).
And asked you to try the command php -v as test to see if your system is finding php-cli

I asked you to run another command as well in efforts to find php-cli for PHP.

which php

that would show the path to the php executables found on your system (you could have multiples).   A command issued from the prompt or a sh script would use the first one found IF using 'php somephpfile.php' from the command line.

'SoS', Ken


Average of ratings: Useful (1)