Much of Australia went into DST mode this week, with the only holdouts being the odd little backwaters of our country (generally referred to as “Queensland”) for whom daylight saving is a threat to curtains or farm animals… and anyone relying on PHP5′s bundled timezone database.
I filed a bug and test case regarding the problem (which will hopefully be be fixed with an official update, given that Hardy is an LTS release), but here’s a quick guide to work around the problem in the mean time. Thanks to Andrew “ajmitch” Mitchell for pointing me in the right direction!
- Grab and unpack the timezonedb extension tarball from PECL.
apt-get install php5-dev
sudo cp modules/timezonedb.so /usr/lib/php5/20060613/
Note: The precise name of the final directory might be different. For instance, on hardy-i386 it will be
sudo vi /etc/php/conf.d/timezonedb.iniYes, this is a new file. Content:
sudo /etc/init.d/apache2 force-reload
Now your PHP has the very latest timezone data up its sleeve, so you can rest easy knowing that your web visitors won’t think you’re a Queenslander.
Update: The php5-timezonedb extension was added to Debian, but removed from intrepid… seems it was because intrepid’s php5 has a patch to use the system tzdata. It would be awesome to get that patch into hardy!
Update: Uh, what about