PHP Question - Safe mode error when setting timezone

L420

New Member
I'm trying to install a PHP application on my server. But I'm getting this error:\[quote\] Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'PHP_TZ' - it's not in the allowed list in .../public/timezone.inc on line 14\[/quote\]I've located the offending file and section of code (below). How would I fix this code? What is PHP_TZ supposed to do? Why doesn't PHP like it? What can I do instead? \[code\]//set the timezoneif ($configdata["timezone"] != "") { putenv("PHP_TZ=" . stripslashes($configdata["timezone"])); putenv("TZ=" . stripslashes($configdata["timezone"])); //for >= PHP 5.1 if(function_exists("date_default_timezone_set")) { date_default_timezone_set($configdata["timezone"]); }\[/code\]I'm on PHP 5.2.10. I tried both 'Europe/Zurich', and 'UTC' for the values for $configdata["timezone"] and got the same error for both.
 
Back
Top