Forums / General Questions / PHP Warning: putenv() has been disabled for security reasons

PHP Warning: putenv() has been disabled for security reasons

Locked

Views: 3,822

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
2 Jan 2015, 3:58 AM
#1
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

PHP Warning: putenv() has been disabled for security reasons

Hello,

I was getting this warming in my log:

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

I am pretty sure it's server-related.

I uncommented lines 27 to 30 in set_time_zone.php as indicated below:

/*  if ($TZ != '') {
    putenv('TZ=' . $TZ);
    @date_default_timezone_set($TZ);
  }
 */

No more warning :smile: ... but if someone sees any reason not to do this please advise.

2 Jan 2015, 4:17 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PHP Warning: putenv() has been disabled for security reasons

You should instead only comment out the putenv line, not the entire "if" statement.

.
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.

2 Jan 2015, 4:28 AM
#3
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: PHP Warning: putenv() has been disabled for security reasons

Thank you. It works!

Happy new year to you!