Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
Thread: changing master value phpinfo
08-05-2012, 10:16 PM #1
changing master value phpinfo
Hi, alittle background first:
I am on a new server and i did a phpinfo and it showed date.timezone as europe/moscow. I am in the USA and so is my host so i dont know whats up with that. When i notified my host they told me they changed it but that was two days ago and it is still showing moscow.
Now for what i did to try to fix this myself:
So what i did was i went into htaccess and used php_value to change the date.timezone to "America/Denver" which worked but it only changed the local value not the master value under DATE header in phpinfo.
I have done some reading and as i understand it, if you set the date.timezone in php.ini then it will change the master value, and then to change the local value you can use htaccess.
I did try to use this in php.ini to change the master value but it did not change.
date.timezone = "America/Denver" i also tried date.timezone = "US/Mountain"
Last edited by durangod; 08-07-2012 at 03:29 AM.
08-05-2012, 10:26 PM #2
- Join Date
- Apr 2011
- London, England
- Thanked 354 Times in 353 Posts
From here. Apparently the ini settings can be over-ridden by a server setting.PHP Code:
How to change default timezone in PHP
Make a file called timezone.php with this in it .
date_default_timezone_set ( "America/Denver" )
and change this line in php.ini
auto_prepend_file = /home/users/web/bxxxx/pow.username/htdocs/timezone.php
Users who have thanked AndrewGSW for this post:
08-06-2012, 07:35 AM #3
- Join Date
- Jan 2010
- Behind the Wall
- Thanked 369 Times in 365 Posts
does it have to be the master value? as long as it *is* changed, does it matter where?
The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.André Behrens, NY Times Software Developer
08-06-2012, 07:41 PM #4
08-06-2012, 11:50 PM #5
- Join Date
- Jun 2008
- New Jersey
- Thanked 259 Times in 256 Posts
Well, basically, no. It doesn't matter what the global value is if the local value is what you want it at. For example, a lot of sites like you pick your timezone. Then as far as the PHP is concerned, you are in that timezone, and of course, that's not changing the server value. Specially if you can't get in on the .ini, the local value is the best you can do (or the htaccess).