Forums | Mahara Community

Developers /
Cron job not running - timezone setting?


Sam Taylor's profile picture
Posts: 60

24 August 2015, 11:51 PM

Hi there

We're having trouble with our cron job not running - the log file has numerous warning lines telling how the timezone isn't supported - this is what we are getting:

[INF] e5 (lib/cron.php:501) Skipping long-running cron job core_webservice_clean_webservice_logs (Mon, 24 Aug 2015 01:34:01 +0000).
[WAR] e5 (lib/cron.php:168) date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Call stack (most recent first):
* log_message("date(): It is not safe to rely on the system's tim...", 8, true, true, "/usr/local/moodle/mahara/lib/cron.php", 168) at /usr/local/moodle/mahara/lib/errors.php:441
* error(2, "date(): It is not safe to rely on the system's tim...", "/usr/local/moodle/mahara/lib/cron.php", 168, array(size 72)) at Unknown:0
* date("r", 1440415562) at /usr/local/moodle/mahara/lib/cron.php:168

 

Any ideas on how to rectify this?

Thanks! 

(Written by Jason - our moodle dev!)

 

anonymous profile picture
Deleted user
Posts: 10

25 August 2015, 1:07 AM

These are just warnings, they should not stop the php code running. But the problem is you have changed version of PHP and the requirement to add a valid timezone setting came in some considerable time back. Quick fix is just to amend the .ini entry for
date.timezone = 'UTC'
as if you are working across more than one time zone, running the server as UTC is the tidy option. Setting it to a local timezone adds the problems where events are added either side of a daylight saving change.

If the cron job is not running it may be some other change in the PHP version change which is the actual problem.

Sam Taylor's profile picture
Posts: 60

25 August 2015, 1:16 AM

Thanks Lester - I'll pass this on to Jason :)

3 results