Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2014
    Location
    Sydney
    Posts
    17
    Plugin Contributions
    1

    Default [Not a bug] Safe Mode warning

    Was getting a debug error like: "Safe Mode warning: Cannot set environment variable 'TZ' - it's not in the allowed list in . ."
    In /includes/extra_configures/set_time_zone.php
    Replaced:
    if ($TZ != '') {
    putenv('TZ=' . $TZ);
    @date_default_timezone_set($TZ);
    }

    with:
    if ($TZ != "") {
    //for >= PHP 5.1
    if(function_exists("date_default_timezone_set")) {
    date_default_timezone_set($TZ);
    // for PHP < 5.1
    } else {
    putenv("TZ=" . stripslashes($TZ));
    }
    }

    Seems to work.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,374
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Safe Mode warning:

    That is not a bug.

    Zen Cart v1.5.3 is designed to work on PHP 5.2.10 or higher.
    Using an older PHP version will probably cause your store to encounter technical problems and ongoing PHP errors.
    .

    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.

  3. #3
    Join Date
    Jan 2014
    Location
    Sydney
    Posts
    17
    Plugin Contributions
    1

    Default Re: Safe Mode warning:

    PHP 5.2.10 eh? Look's like it's running 5.3.28.

    Name:  zc.jpg
Views: 352
Size:  29.8 KB

    Hmmm, I just put the original code back and it started to get the debug errors again. I will now put my updated code back in.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,374
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Safe Mode warning:

    Can't replicate your situation on my PHP 5.3.28 using ZC v1.5.3
    .

    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.

  5. #5
    Join Date
    Jan 2014
    Location
    Sydney
    Posts
    17
    Plugin Contributions
    1

    Default Re: Safe Mode warning:

    If I changed TZ to PHP_TZ, it worked.

  6. #6
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Safe Mode warning:

    Crapy hosting like one.com will give this issue. Move to a decent one instead, as this is only one of many issues they will cause. ;)

 

 

Similar Threads

  1. Replies: 13
    Last Post: 8 Feb 2016, 05:13 PM
  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. Warning: set_time_limit() : Cannot set time limit in safe mode
    By cstorenl in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 Jan 2012, 03:38 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR