Author Topic: Solved: Cannot Set Timezone  (Read 9195 times)

Offline johnywhy

  • Jr. Member
  • **
  • Posts: 14
Solved: Cannot Set Timezone
« on: March 15, 2013, 07:42:26 AM »
hi, i've tried setting timezone with both php.ini and .htaccess, but nothing works.

setting in .htaccess returns Internal Server Error
php_value    date.timezone    America/Los_Angeles

setting in php.ini returns date.timezone:  NOT OK(empty value detected)
date.timezone = America/Los_Angeles

what should i do?

roundcube Complete: 0.8.5
phpinfo: http://inyourear.org/roundcube/phpinfo.php

thanks
« Last Edit: March 15, 2013, 10:04:31 AM by johnywhy »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,568
    • http://SKaero.com/
Re: Cannot Set Timezone
« Reply #1 on: March 15, 2013, 08:11:52 AM »
If you set the date.timezone in a php.ini file in the main RoundCube folder you will also need a copy of that php.ini in the installer directory in order to run the install.

Offline johnywhy

  • Jr. Member
  • **
  • Posts: 14
Re: Cannot Set Timezone
« Reply #2 on: March 15, 2013, 08:25:23 AM »
you will also need a copy of that php.ini in the installer directory
bingo.

thanks!

Offline ch3

  • Newbie
  • *
  • Posts: 3
Re: Solved: Cannot Set Timezone
« Reply #3 on: April 07, 2013, 09:59:40 PM »
Hi there,
I still have problems setting up the date.timezone
I don't have full access to the hosting server, so I can't edit any files other than within my user directory.
I tried to add a php.ini file in both the root of the roundcube directory and also the installer directory, but without any luck.
The php.ini contains only this line:
date.timezone = Canada/Vancouver

Do I miss anything?

thank you
georgios

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,568
    • http://SKaero.com/
Re: Solved: Cannot Set Timezone
« Reply #4 on: April 08, 2013, 01:13:57 PM »
Canada/Vancouver is not a valid date.timezone, I think you want America/Vancouver. See the full list of supported date.timezone values at: http://www.php.net/manual/en/timezones.php

Offline ch3

  • Newbie
  • *
  • Posts: 3
Re: Solved: Cannot Set Timezone
« Reply #5 on: April 09, 2013, 12:38:52 AM »
Still nothing.

You can also check the phpInfo I dropped into the same directory.
http://test.ch3.gr/phpInfo.php

Just to clarify I have a php.ini under
http://test.ch3.gr/
and a copy under
http://test.ch3.gr/installer/
with the permissions set to -rw-r--r--


Out of curiosity, is it the case that if php finds a php.ini file in the same directory where it's running, it sources it first to set the various settings?


thanks
georgios

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,568
    • http://SKaero.com/
Re: Solved: Cannot Set Timezone
« Reply #6 on: April 09, 2013, 03:22:50 AM »
Looks like your server is using FastCGI, I don't think you can use a php.ini in the same directory unless your using SuPHP. I think it also works with some others php configurations but I haven't tested it. Have you tried setting date.timezone in a .htaccess file?

Offline ch3

  • Newbie
  • *
  • Posts: 3
Re: Solved: Cannot Set Timezone
« Reply #7 on: April 12, 2013, 01:12:27 AM »
Yeah, it's a shared host server, so I guess I am not allowed to change the php.ini
I now tried adding a .htaccess in both the root and the /installer/ with this line
php_value date.timezone "America/Vancouver"
but still nothing.

I also tried to edit the index.php and the rcube_install.php by adding the line below, but still nothing
putenv("TZ=America/Vancouver");


Would it be easy enough to set the timezone within the application's settings instead, in the same way wordpress or other applications do?


thanks for your assistance
georgios

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,568
    • http://SKaero.com/
Re: Solved: Cannot Set Timezone
« Reply #8 on: April 12, 2013, 02:08:38 AM »
The date.timezone is required because RoundCube time and date functions which rely on it. If its not set it fills up error logs with warnings and you wont see dates on your emails. Try adding the following to the top (right after <?php) of both the <RC root>/index.php and the <RC root>/installer/index.php files:
Code: [Select]
ini_set('date.timezone', 'America/Vancouver');
« Last Edit: April 12, 2013, 02:16:23 AM by SKaero »