Php 5.3.0 & TomatoCart (The online store stop working due to the wrong system’s timezone)
Written by Jack Yin Friday, 24 August 2012
After upgrading webservers to new stable 5.3.0, tomatocart started to give following errors to every page:
Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn’t valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.
This is not a TomatoCart issue. It’s a PHP configuration issue which is triggered when the very simple common “date()” function is called within PHP. If you fix your timezone settings in your PHP configuration, the problem should go away.
There are two approaches to to let php know what your time zone is:
- You can edit your php.ini file and put in the following line as date.timezone = “America/Anchorage”. Please find your valid time zone at You can find valid time zone strings at http://www.php.net/manual/en/timezones.php
- If you don’t have access to the php.ini, adding your time zone string to the top of application_top.php located in the includes directory. It will do much the same thing:date_default_timezone_set(‘America/Chicago’);Use whatever timezone is appropriate for you, of course. List is here:
In the version 1.1.8, TomatoCart will add a timezone setting under Configuration->Configuration->My Store in the admin panel. In this case, if necessary, the user just need to set it in the admin panel.
Figure 1. TimeZone Setting under Configuraion->My Store
If the php version on your web server is greater than 5.3.0, please fix the issue about the time zone as above.