Wth php 5.3 starts to have a lot of warnings It is not safe to rely on the system's time in apache logs

Bug #922057 reported by Patrick Pollet
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
Expired
Medium
Unassigned

Bug Description

mahara 1.5 dev master
php version :
PHP 5.3.3 (cli) (built: Nov 3 2011 12:00:26)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

With php set in full error reporting mode , my apache errors logs get filled with warnings about 'It is not safe to rely on the system's timezone settings'

[Mon Jan 23 14:51:49 2012] [error] [client 134.214.152.108] [WAR] 6a (lib/mahara.php:2884) 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 'Europe/Berlin' for 'CET/1,0/no DST' instead, referer: http://xxxxxxxxxxxxxxxx/mahara/user/find.php?limit=99
...

[Thu Jan 26 13:24:05 2012] [error] [client 134.214.152.108] * log_message("date(): It is not safe to rely on the system's tim...", 8, true, true, "/var/www/html/mahara.git/htdocs/lib/mahara.php", 2884) at /var/www/html/mahara.git/htdocs/lib/errors.php:446, referer: http://xxxxxxxx/mahara/
[Thu Jan 26 13:24:05 2012] [error] [client 134.214.152.108] * error(2, "date(): It is not safe to rely on the system's tim...", "/var/www/html/mahara.git/htdocs/lib/mahara.php", 2884, array(size 2)) at Unknown:0, referer: http://xxxxxxx/mahara/
[Thu Jan 26 13:24:05 2012] [error] [client 134.214.152.108] * date("Y-m-d h:i:s") at /var/www/html/mahara.git/htdocs/lib/mahara.php:2884, referer: http://xxxxxxx/mahara/
[Thu Jan 26 13:24:05 2012] [error] [client 134.214.152.108] * mahara_log("views", "6") at /var/www/html/mahara.git/htdocs/user/view.php:289, referer: http://xxxxxxxxx/mahara/

I did fixed it by adding at the end of config.php

// quick fix on my place
//date_default_timezone_set("Europe/Berlin");

//a better fix
if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) {
 @date_default_timezone_set(@date_default_timezone_get());
}

But I guess it might be time to add to Mahara's site configuration a setting about 'server timezone' and use it 'a la Moodle'

Cheers.

Patrick Pollet (pp-c)
description: updated
description: updated
Patrick Pollet (pp-c)
description: updated
Changed in mahara:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 1.5.0
Changed in mahara:
assignee: nobody → Christopher Tombleson (christopher-k)
Revision history for this message
François Marier (fmarier) wrote :
Revision history for this message
François Marier (fmarier) wrote :

We haven't really been able to reproduce this on our normal development or production machines.

Could it be a configuration problem on your server?

If so, I guess having the warnings in the error log until you fix it in your php.ini is a good thing that we shouldn't silently work-around.

If not, then we'd need more information as to when this configuration can occur.

Changed in mahara:
status: Triaged → Incomplete
assignee: Christopher Tombleson (christopher-k) → nobody
milestone: 1.5.0 → none
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Mahara because there has been no activity for 60 days.]

Changed in mahara:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.