Cron jobs wont run undefined function current_language()

Cron jobs wont run undefined function current_language()

by Tim Titchmarsh -
Number of replies: 2

Hi

I've manually upgraded to 3.7. all appears ok apart from the cron jobs not running. I have tried running manually and via cli but I get a "undefined function current_language()" in lib/setuplib/php line 713

php -q /home/c11pluss/public_html/testcenter/admin/cli/cron.php

I have a cli path /usr/bin/php set.

I can see line 713 that make the call to function current_language()  (in moodlelib.php) which is there of course but maybe not loaded before  this?

Cron jobs have run in the past versions ok but not in the current 3.7.

Any ideas please.


Update, now Fixed: needed to use cmdlline php72  -q /home/c11pluss/public_html/testcenter/admin/cli/cron.php

Thanks, Tim

Average of ratings: -
In reply to Tim Titchmarsh

Re: Cron jobs wont run undefined function current_language()

by Daniel García -

Hey Tim, Im having a similar error when executing the schedule_task.php file. After reading your post I tried to execute the cron.php file and I got the same exact error.

We were searching and some people said that you needed to use php 7.2 to fix the issue however we did and the issue still appears when executing those php files.

One thing I noticed is that we don't have that php72 executable that you put in your update. Can you please let me know how or where did you find that executable?


Update: I had to run the php from the php7.2 folder as the php command wasn't working now I don't see that error

Thanks a lot in advance!

Kind regards

Daniel Garcia


In reply to Daniel García

Re: Cron jobs wont run undefined function current_language()

by Tim Titchmarsh -

Hi Daniel

I use siteground for my hosting and in the control panel can set the cron job up with the command line. I had left mine untouched at php (should have been php72) even though I had upgraded my version of PHP to 7.2. This was my mistake so I changed my cron setting in siteground to

php72 -q xxxxx/admin/cli/cron.php

where xxx is the path to your moodle directory


hope that helps

Regards

Tim