Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,383
    Thanks
    264
    Thanked 32 Times in 31 Posts

    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.

    Code:
    date.timezone = "America/Denver"
    i also tried 
    date.timezone = "US/Mountain"
    Neither of these worked to change the master value, so my question is how do i change the master value, or can i?
    Last edited by durangod; 08-07-2012 at 02:29 AM.

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    PHP Code:
    How to change default timezone in PHP
    Make a file called timezone.php with this in it .
    PHP Code:
    <? 
    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
    From here. Apparently the ini settings can be over-ridden by a server setting.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • Users who have thanked AndrewGSW for this post:

    durangod (08-06-2012)

  • #3
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,280
    Thanks
    12
    Thanked 342 Times in 338 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

  • #4
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,383
    Thanks
    264
    Thanked 32 Times in 31 Posts
    Quote Originally Posted by Dormilich View Post
    does it have to be the master value? as long as it *is* changed, does it matter where?
    I suppose not, i am concerned that it is moscow to begin with but i suppose as long as the local value is correct, it does not matter what the master value is (i hope so anyway). That is another reason i asked because i dont know for sure, and i also wanted to learn something from this.

  • #5
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    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).


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •