Page 1 of 1

Greyhole - PHP Warning

Posted: Sun Feb 13, 2011 5:27 pm
by JohnWhitmore
Hi all,

got a new Amahi/Fedora14 setup going.
I am finding the following error occurs

PHP Warning: date_default_timezone_get(): 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 'Pacific/Auckland' for 'NZDT/13.0/DST' instead in /usr/bin/greyhole on line 39

This happens from time to time in terminal. It occurs everytime I type
while [ 1 == 1 ]; do greyhole --view-queue | grep Total; sleep 60; done
to see the Greyhole operations queue.

Is this an easy fix? What should I change the line to ready?

I note the line currently reads
date_default_timezone_set(date_default_timezone_get());

Is this a bug...or a newbie issue. I am new to linux and still getting my head around the commands etc

Thanks
John

Re: Greyhole - PHP Warning

Posted: Mon Feb 14, 2011 5:50 am
by bigfoot65
Hello,

This is a problem with Fedora 14. What you can do to make the warning go away is change:

date_default_timezone_set(date_default_timezone_get());

to read as this:

date_default_timezone_set('Pacific/Auckland');

That's what I did on my system and the message disappeared. This is something we are looking into, but unsure when it will be resolved.

Re: Greyhole - PHP Warning

Posted: Mon Feb 14, 2011 1:08 pm
by LittleMike
Hello,

This is a problem with Fedora 14. What you can do to make the warning go away is change:

date_default_timezone_set(date_default_timezone_get());

to read as this:

date_default_timezone_set('Pacific/Auckland');

That's what I did on my system and the message disappeared. This is something we are looking into, but unsure when it will be resolved.
I also get this error message using Fedora 12. I will try the above fix and see if it resolves the issue.

Thanks,
Mike

Re: Greyhole - PHP Warning

Posted: Mon Feb 14, 2011 6:17 pm
by gboudreau
The correct way to fix this is to add a line in your /etc/php.ini file:

date.timezone = "America/Montreal"

The list of available timezone values you can use can be found here: http://www.php.net/manual/en/timezones.php

Re: Greyhole - PHP Warning

Posted: Mon Feb 14, 2011 8:45 pm
by LittleMike
The correct way to fix this is to add a line in your /etc/php.ini file:

date.timezone = "US/Central"

The list of available timezone values you can use can be found here: http://www.php.net/manual/en/timezones.php
Comments in the link you posted say that the US/Central format is no longer officially supported and that you should use the America/City format instead. Which one should we use to ensure compatibility?

Re: Greyhole - PHP Warning

Posted: Tue Feb 15, 2011 3:40 am
by gboudreau
Continent/City format is what should be used; fixed my post above to reflect this.

Re: Greyhole - PHP Warning

Posted: Tue Feb 15, 2011 10:05 am
by LittleMike
Continent/City format is what should be used; fixed my post above to reflect this.
Gotcha. Thanks for the update :)

Re: Greyhole - PHP Warning

Posted: Tue Feb 22, 2011 8:08 am
by cosmin
should it be any zone or the correct timezone? i live in europe so american timezone is not technically correct

Re: Greyhole - PHP Warning

Posted: Tue Feb 22, 2011 8:11 am
by gboudreau
It should be your own timezone.