TimeZone Error in PHP apps
Some Amahi applications do not work in F12 due to the timezone not being set in the /etc/php.ini file. This can be corrected by changing the following line to read:
date.timezone="America/Chicago" instead of date.timezone=""
Currently researching to see if there is a native Fedora 12 variable that holds timezone that can be used.
#1 Updated by bigfoot65 over 12 years ago
The time zone setting Fedora 12 is in /etc/sysconfig/clock. There is an entry as follows: ZONE="America/Chicago"
Does not appear to be a variable that can be used via CLI. Need to determine how to extract this information from the file and incorporate it in /etc/php.ini
#2 Updated by cpg over 12 years ago
as an environment variable it's easy for an install script to get:
[19:03:02](1)florence:~$ . /etc/sysconfig/clock
[19:03:07](1)florence:~$ echo $ZONE
(though it should always be handled with care, probably, because of the space in there, to be more general.)
i wonder if we can put this in custom options.
the installer would always have $ZONE defined and apps that need timezone support could add it to the custom options just to get by for now.
#3 Updated by cpg over 12 years ago
we can do this in two steps. the second one being the hard one (change in the installer).
1) try this in custom options (make sure you leave the /etc/php.ini factory-intact!!):
php_value date.timezone "America/Los Angeles"
2) we can somehow replace some environment variables in the custom options, like $ZONE
#8 Updated by bigfoot65 over 12 years ago
Some apps display as a blank page due to the time zone being incorrectly set in php.ini. Any time zone with a space, i.e. America/Los Angeles must be set as America/Los_Angeles in the php.ini file. Any time zone with a space must have it replaced with an underscore. Those with dashes or slashes are unaffected.
Sample error message:
PHP Warning: strftime(): 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/Los_Angeles' for 'PST/-8.0/no DST' instead in /var/hda/web-apps/horde/html/config/prefs.php on line 322, referer: http://192.168.0.30/setup?sub=available&tab=app
A patch has been created by cpg to correct this issue.
Also available in: Atom