PHP summer time off

Posted by 6bytes at 14, August, 2009

Category: Linux, PHP


PHP has a bug with applying summertime in some timezones. If you’ve set correct timezone in your php.ini file and running

< ?php
echo date("r");

still gives you wrong time its quite possible that you’ve just found this bug.


To correct this you need to install new timezone file. Run below command on your server:

$ pecl install timezonedb

Successful installation should result in something like this

Build process completed successfully
Installing '/usr/local/lib/php/extensions/debug-non-zts-20060613/'
install ok: channel://
configuration option "php_ini" is not set to php.ini location
You should add "" to php.ini

open your php.ini file

$ vim /etc/php.ini

add line “” as instructed.

If PHP now surprises you with

PHP Warning:  PHP Startup: Unable to load dynamic library './' - 
./ cannot open shared object file: No such file or directory in 
Unknown on line 0

you need to add full path to the “” file in your php.ini
Install process returns the full path to “” but if you need to find it type:

$ find / -name

edit your php.ini once more and change