Roundcube Community Forum

 

Solved: Cannot Set Timezone

Started by johnywhy, March 15, 2013, 07:42:26 AM

Previous topic - Next topic

johnywhy

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

SKaero

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.

johnywhy

Quote from: SKaero on March 15, 2013, 08:11:52 AMyou will also need a copy of that php.ini in the installer directory
bingo.

thanks!

ch3

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

SKaero

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

ch3

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

SKaero

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?

ch3

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

SKaero

#8
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:

ini_set('date.timezone', 'America/Vancouver');