Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default putenv and set_time_zone.php

    i encountered the following error which caused ZC to stop loading:

    Warning: putenv() has been disabled for security reasons in /SERVER/includes/extra_configures/set_time_zone.php on line 28

    i think we should do something to alert people if they run into this problem.

    i can look into it and hopefully do a PR on it if warranted....
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

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

    Default Re: putenv and set_time_zone.php

    Strictly speaking, a "warning" shouldn't stop ZC from loading. Only fatal errors should do that. So maybe something else is also triggering a fatal error?

    Try wrapping the putenv in a try/catch, where the catch just does nothing. If the env var can't be set, there's no recovery, and no need to do any catalog-side alerts that will just confuse the shopper. And admin-side, I would expect if there's really an issue then the timezone display already in the menubar should be enough to alert the admin that there's an issue.
    .

    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
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: putenv and set_time_zone.php

    Quote Originally Posted by DrByte View Post
    Strictly speaking, a "warning" shouldn't stop ZC from loading. Only fatal errors should do that. So maybe something else is also triggering a fatal error?
    there is no question that this warning stopped ZC from loading. no question. how the server is configured is another topic, and i'm just helping someone out on the forum.

    this disabled function can be enabled in the php.ini file. and i have a feeling that there is something on the php.ini that might stop the execution based on the warning.

    i will look into your suggested solution when i have some time.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: putenv and set_time_zone.php

    try catch did not work....

    also found this:

    https://www.zen-cart.com/showthread....curity-reasons

    would have been nice to address it then......
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: putenv and set_time_zone.php

    i am going to move this discussion over to github....
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: putenv and set_time_zone.php

    Quote Originally Posted by carlwhat View Post
    https://www.zen-cart.com/showthread....curity-reasons

    would have been nice to address it then......
    The answer given "then" was and still is accurate.

    The more important issue is: WHY did the host disable putenv? Given that this is just the second post in 3 years, it seems like there's something unique about this current server that's wildly restrictive compared to most.

    You said you think something should be done to alert people if they run into this problem. What exactly are you proposing?
    People already complain that there's too much alerting, particularly catalog-side. Adding more alerts feels counterintuitive. A silent ignoring of the error whilst falling back to a sensible default seems applicable here.

    One "could" prefix it with an "@" to completely suppress the error, but that's an antipattern which I prefer to avoid.
    .

    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: 2
    Last Post: 12 Jun 2015, 10:11 PM
  2. v153 PHP Warning: putenv() has been disabled for security reasons
    By Thannaree in forum General Questions
    Replies: 2
    Last Post: 2 Jan 2015, 05:28 AM
  3. lay out inconsistency between index.php and alt_nav.php
    By Lucky1968 in forum Customization from the Admin
    Replies: 2
    Last Post: 4 Mar 2011, 09:23 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