Altering timezone on shared PHP/MySQL server

Discussion in 'Web Design and Development' started by big_malk, Sep 7, 2008.

  1. big_malk macrumors 6502a

    Joined:
    Aug 7, 2005
    Location:
    Scotland
    #1
    Is it generally possible to alter the time/timezone settings on a shared server?
    Obviously I only have limited access to settings and I don't know if this is one of the per-directory options.

    If possible I'd like to be able to use the current timestamp in MySQL to get a time in my timezone (UK, server is in US), or even if I could just get PHP to give mktime() in my timezone it would be a lot easier.

    If that not possible, is there a reliable and easy way to compensate, which won't need changing when daylight savings time changes?

    The server is running...
    Linux 2.6.9-67.0.22.ELsmp (SMP)
    Apache 2.0 Handler (?)
    MySQL 4.0.21
    phpMyAdmin 2.9.2
    PHP version 4.3.11

    P.S. Also, can I turn session.auto_start on?
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    Mosts hosts do not allow that as space is partitioned or virtual hosts are setup all using the same CPU and time resources. You have to ask your host to be sure, as some use fair share with full root and do allow you to screw up the time and session directives. Note: I said "screw up" because most *nix boxes use NNTP time servers to sync the time at least once per day, so no human intervention is involved in fixing time, and sessions are domain dependent and should never be applied globally in a shared environment.

    As to the rest, see http://forums.macrumors.com/showthread.php?t=558584
     

Share This Page