Forums | Mahara Community

Support /
Timezone error


Andrew Lian's profile picture
Posts: 15

23 November 2011, 8:41

Hello

I appear to have installed mahara correctly.

When I tried to run it though, I received the following error (many times):

Warning: error_log() [function.error-log]: 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 'America/Chicago' for 'CST/-6.0/no DST' instead in/home/mlapl1/public_html/mahara/lib/errors.php on line 243

And then

ERROR - something bad happened after headers have been sent. Check the error log for more information.

I have checked the error logs but see nothing significant. There were errors at setup time that did not stop the setup/installation.

This timezone problem is quite debilitating.

Thanks for any help

Andrew

anonymous profile picture
Account deleted
Posts: 197

24 November 2011, 16:52

Hi Andrew,

The date.timezone setting is set in the php.ini file. You will need to check what is currently set in the apache version of the php.ini file which, if you're using ubuntu or debian, should be at /etc/php5/apache2/php.ini. A list of supported timezones is at http://php.net/manual/en/timezones.php.

Hope this helps.

Thanks,
Melissa

Andrew Lian's profile picture
Posts: 15

27 November 2011, 6:48

Thanks Melissa - I actually set it in .htaccess and it now seems to work fine.

Cheers

Andrew

anonymous profile picture
Account deleted
Posts: 9

03 April 2013, 16:26

I am getting the same kind of message:

Warning: error_log() [function.error-log]: 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 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/idp/public_html/lib/errors.php on line 243

I have downloaded my Mahara php.int file and cannot find any reference to "timezone" at all.  Can I have a little guidance with this please?

Using Mahara version: 1.5.1

Aaron Wells's profile picture
Posts: 896

03 April 2013, 17:49

Hi Anita,

  • What operating system are you using (and/or is it "shared hosting")?
  • What version of PHP do you have installed?
  • Does your php.ini file have a [Date] section?

If there is a [Date] section in your php.ini file, you need to add a line below it like this:

date.timezone = Pacific/Auckland

Except instead of "Pacific/Auckland", you want to put your actual timezone, from the lists here: http://www.php.net/manual/en/timezones.php . (Unless you're in New Zealand ;)

Cheers,
Aaron

anonymous profile picture
Account deleted
Posts: 9

03 April 2013, 19:23

Hello,

Thanks for your reply.

  • Yes I am using shared hosting with hostgator.
  • My PHP version is 5.2.17
  • I don't find a [ Date ] section in the file when I search "find" with Dreamweaver.

From the link provided I see I will need "America/Detroit" once I can figure out what exactly to add.

anonymous profile picture
Account deleted
Posts: 26

03 April 2013, 21:16

 

Instead of messing around with php.ini ,you may try to add the following near the end of the Mahara's config.php file  see  https://bugs.launchpad.net/mahara/+bug/922057


date_default_timezone_set("America/Detroit");

or this  better fix :

 

if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) {
 @date_default_timezone_set(@date_default_timezone_get());
}

Cheers

 

anonymous profile picture
Account deleted
Posts: 9

03 April 2013, 23:42

PERFECT!  Thanks so much for the quick fix.

I used the "better" one at the end of Mahara's config.php as suggested...


Aaron Wells's profile picture
Posts: 896

04 April 2013, 10:44

Thanks Patrick, that's a great suggestion, especially for users who don't have access to their php.ini or aren't comfortable editing it. Smile

Cheers,
Aaron

A post by Account deleted was deleted

10 results