Developers:

Categories

Discussion Tag Cloud

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

Member
WoodyGilkAdministrator
Member
Member
    •  
      CommentAuthorveddermatic
    • CommentTimeJul 31st 2009 edited
     

    EDIT: New PHP = new pnp.inf = need to set Timezone in it... user error, but in case anyone else runs into this, they can learn from my stupidity :)

    I was running Kohana 2.3.2. Upgraded PHP to 5.3.0, and was treated to this on every page of my site:

    ===

    Warning: date_default_timezone_get() [function.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 'America/New_York' for 'EDT/-4.0/DST' instead in /Library/WebServer/Documents/system/core/Kohana.php on line 136

    ===

    Upgraded Kohana to 2.3.4, same error (different line number, I think =)

    Server info: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7l DAV/2 PHP/5.3.0

    The fix is pretty straightforward, I will replace:

    date_default_timezone_set(empty($timezone) ? date_default_timezone_get() : $timezone);

    With:

    date_default_timezone_set(empty($timezone) ? 'UTC' : $timezone);

    But I don't know if this will be a common problem with PHP 5.3.x and needs to be addressed, or if it's just a rarity.

    •  
      CommentAuthorshadowhand
    • CommentTimeJul 31st 2009
     

    That error would be triggered in any PHP 5.x version with E_STRICT enabled. However, that line should have E_STRICT and E_NOTICE disabled already, via the error_reporting() call above.

    What kind of error message is it? Warning?

  1.  

    You have to set the timezone in your php.ini. Make sure it's set.

  2.  
    Posted By: The Pixel Developer

    You have to set the timezone in yourphp.ini. Make sure it's set.

    Bah! Silly me. The new PHP installs php.inf had that line commented out. Duh. Nothing to see here... move along....

    •  
      CommentAuthororbinary
    • CommentTimeAug 10th 2009
     

    I also ran into this issue on Kohana 2.3.4 and PHP 5.3.0 and resolved it thanks to this thread. Since the error is a bit cryptic, seems to me like it'd be straightforward to add a Timezone check to install.php, like:

    <?php if (strlen(ini_get('date.timezone')) > 0): ?>
    ...
    <td class="fail">Must set date.timezone in php.ini.</td>

    I had a "stock" install of PHP 5.3.0 with minimal customization on a Windows environment - I guess timezone defaults to unset. Anyway, thanks for the info.