Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    UK
    Posts
    398
    Plugin Contributions
    0

    Default Warning: strtotime(): It is not safe to rely on the system's timezone settings.

    Hi

    I have just installed a copy of zencart on my server that is Linux based.

    After the installation i have removed the ZC_Install folder as requested.

    Then the admin folder was renamed too.

    When i goto login into my admin i get this error :


    Warning: strtotime(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /websites/123reg/LinuxPackage22/fa/tm/oo/TEST.com/public_html/TEST A/TEST/login.php on line 13


    Now, i am not sure what the issue is and how i can fix this... any ideas ??

    By the way, i have used the same sever to run other zencart sites with NO issues.

    Thank you

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,877
    Plugin Contributions
    96

    Default Re: Admin page error

    You'll need to edit the file /includes/extra_configures/set_time_zone.php, adding your time-zone in the spot indicated. Check here (http://us.php.net/manual/en/timezones.europe.php) for the supported constants in Europe, e.g. 'Europe/London':
    Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2013 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version GIT: $Id: Author: DrByte  Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
     */
    /*
     * Set time zone
    */
    if (version_compare(PHP_VERSION, 5.3, '>='))
    {
      // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      $TZ = '';  // eg: 'Europe/Oslo'
    
    
    
      /**
       * MAKE NO CHANGES BELOW THIS LINE
       *
       * The following will take the timezone you specified above and apply it in your store.
       * If you didn't specify one, it will try to use the setting from your server's PHP configuration
       */
      if ($TZ == '') {
        $TZ = date_default_timezone_get();
      }
      if ($TZ != '') {
        putenv('TZ=' . $TZ);
        @date_default_timezone_set($TZ);
      }
    }
    The same timezone setting will be used for your Zen Cart admin-console.

  3. #3
    Join Date
    May 2008
    Location
    UK
    Posts
    398
    Plugin Contributions
    0

    Default Re: Admin page error

    hi

    thank you for your reply
    sorry to ask you this but where would the time zone go in the script ?

    would it be like this ??? ---->>

    <?php
    /**
    * @package initSystem
    * @copyright Copyright 2003-2013 Zen Cart Development Team
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version GIT: $Id: Author: DrByte Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
    */
    /*
    * Set time zone
    */
    if (version_compare(PHP_VERSION, 5.3, '>='))
    {
    // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
    $TZ = ''; // eg: 'Europe/London'


    Where my time zone is Europe/London



    Thank you

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,877
    Plugin Contributions
    96

    Default Re: Warning: strtotime(): It is not safe to rely on the system's timezone settings.

    Edit the file, adding your timezone as highlighted below:
    Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2013 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version GIT: $Id: Author: DrByte  Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
     */
    /*
     * Set time zone
    */
    if (version_compare(PHP_VERSION, 5.3, '>='))
    {
      // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      $TZ = 'Europe/London';  // eg: 'Europe/Oslo'
    
    
    
      /**
       * MAKE NO CHANGES BELOW THIS LINE
       *
       * The following will take the timezone you specified above and apply it in your store.
       * If you didn't specify one, it will try to use the setting from your server's PHP configuration
       */
      if ($TZ == '') {
        $TZ = date_default_timezone_get();
      }
      if ($TZ != '') {
        putenv('TZ=' . $TZ);
        @date_default_timezone_set($TZ);
      }
    }

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Admin page error

    Set like this
    PHP Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2013 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version GIT: $Id: Author: DrByte  Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
     */
    /*
     * Set time zone
    */
    if (version_compare(PHP_VERSION5.3'>='))
    {
      
    // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      
    $TZ 'Europe/London';  // eg: 'Europe/London'

  6. #6
    Join Date
    May 2008
    Location
    UK
    Posts
    398
    Plugin Contributions
    0

    Default Re: Admin page error

    Thank you for all your help.... much appreciated.

    However, even after making the changes i am still getting this error message after i log in to the admin area...

    Warning: strtotime(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /websites/123reg/LinuxPackage22/fa/tm/oo/TEST.com/public_html/TEST A/Testadmin/login.php on line 13


    My file that i have edited is located at : includes/extra configures/set_time_zone.php

    the contents of the file are :

    Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2013 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version GIT: $Id: Author: DrByte  Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
     */
    /*
     * Set time zone
    */
    if (version_compare(PHP_VERSION, 5.3, '>='))
    {
      // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      $TZ = 'Europe/London';  // eg: 'Europe/Oslo'
    
    
    
      /**
       * MAKE NO CHANGES BELOW THIS LINE
       *
       * The following will take the timezone you specified above and apply it in your store.
       * If you didn't specify one, it will try to use the setting from your server's PHP configuration
       */
      if ($TZ == '') {
        $TZ = date_default_timezone_get();
      }
      if ($TZ != '') {
        putenv('TZ=' . $TZ);
        @date_default_timezone_set($TZ);
      }
    }
    I am sure that i have followed the instructions but still this error is causing me issues.



    Thanks for your help.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Admin page error

    What version of PHP is beng used/seen by the cart as reported n the admin's version information screen?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Warning: strtotime(): It is not safe to rely on the system's timezone settings.

    Quote Originally Posted by amebb View Post
    When i goto login into my admin i get this error :

    Warning: ... /login.php on line 13
    Given that it's happening only on the login page, it looks like you're tripping over a bug in your version of Zen Cart.
    Simple fix here: https://www.zen-cart.com/showthread....93#post1296793
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 18 Dec 2015, 12:46 AM
  2. v151 PHP warning: It is not safe to rely on the system's timezone settings.
    By cseright7 in forum General Questions
    Replies: 12
    Last Post: 24 Oct 2015, 05:46 AM
  3. v151 It is not safe to rely on the system's timezone settings. You are *required* to use t
    By lauragibbons116 in forum Built-in Shipping and Payment Modules
    Replies: 40
    Last Post: 25 Jan 2014, 02:13 AM
  4. v150 Warning: strtotime(): It is not safe to rely on the system's timezone settings.
    By Sanguinarius in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 29 Jul 2013, 11:40 PM
  5. Replies: 5
    Last Post: 27 Feb 2012, 08:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg