Nginx – PHP-FPM Chroot jail corrupts timezone db

chrootnginxphp-fpm

I'm trying to setup a PHP-FPM Chroot jail on a new CentOS 6.3 box. I can get the chroot to work fine, in the sense that I can get php scripts to respond and echo things out. But, every time I use the date function, I get an error saying the timezone db is corrupt.

All I've done is changed the value of the chroot directive in php-fpm conf, to be the document root as specified in nginx.

This is the test script:

https://gist.github.com/3199578

this is the nginx vhost

https://gist.github.com/3199552

Here's the output I get when I go to localhost

https://gist.github.com/3199602

Best Answer

do you have copy of TZ stuff inside the chroot folder ?

/etc/localtime 

-and-

/usr/share/zoneinfo

to

/chroot/path/etc/localtime 

-and-

/chroot/path/usr/share/zoneinfo

also maybe add

add TZ=CST (or whatever your TZ is) in the nginx config details here: http://wiki.nginx.org/CoreModule#env