Welcome! Log In Create A New Profile

Advanced

FPM Chroot and corrupt timezone fatal error

Posted by Vid Luther 
Vid Luther
FPM Chroot and corrupt timezone fatal error
May 29, 2012 01:04PM
I tried to run WordPress this morning off a jailed environment. Some parts
ran fine, but some scripts that called either strtotime, or date(''Y")
failed spectacularly by telling me that the timezone db was corrupt, and it
should never have happened.

Googling suggest that for every chroot Jail I set up, I'd need to expose
/etc/localtime .. there were no responses, or google didn't think so, past
early 2011, so I was wondering if there's something I'm missing about this
chroot and timezone corruption issue?

It doesn't seem to be a WordPress specific thing too, even a date('Y') in a
phpinfo.php script resulted in this error.

I even tried

php_admin_value[date.timezone] = 'America/Chicago'

But that didn't do anything.

Any tips? Thanks in advance.
Jérôme Loyet
Re: FPM Chroot and corrupt timezone fatal error
May 29, 2012 01:18PM
2012/5/29 Vid Luther <vid@zippykid.com>:
> I tried to run WordPress this morning off a jailed environment. Some parts
> ran fine, but some scripts that called either strtotime, or date(''Y")
> failed spectacularly by telling me that the timezone db was corrupt, and it
> should never have happened.
>
> Googling suggest that for every chroot Jail I set up, I'd need to expose
> /etc/localtime .. there were no responses, or google didn't think so, past
> early 2011, so I was wondering if there's something I'm missing about this
> chroot and timezone corruption issue?
>
> It doesn't seem to be a WordPress specific thing too, even a date('Y') in a
> phpinfo.php script resulted in this error.
>
> I even tried
>
> php_admin_value[date.timezone] = 'America/Chicago'
>
> But that didn't do anything.
>
> Any tips? Thanks in advance.

I've just tried to create a simple chroot pool and the date function
is working like a charm' on my developement linux box (ubuntu 11.04).
What OS are you running for this ?

++ fat
Vid Luther
Re: FPM Chroot and corrupt timezone fatal error
May 29, 2012 04:04PM
On Tue, May 29, 2012 at 12:17 PM, Jérôme Loyet <ml@fatbsd.com> wrote:

>
>
> I've just tried to create a simple chroot pool and the date function
> is working like a charm' on my developement linux box (ubuntu 11.04).
> What OS are you running for this ?
>
> ++ fat
>


CentOS 6.2 using PHP 5.4.3 RPMS from Remi.
I'll set up a test environment that's public and send more info.
Re: FPM Chroot and corrupt timezone fatal error
July 01, 2012 05:58PM
I have the same problem here...

Do you figure out why?

Thanks

Em terça-feira, 29 de maio de 2012 17h03min00s UTC-3, Vid Luther escreveu:
>
> On Tue, May 29, 2012 at 12:17 PM, Jérôme Loyet <ml@fatbsd.com> wrote:
>
>>
>>
>> I've just tried to create a simple chroot pool and the date function
>> is working like a charm' on my developement linux box (ubuntu 11.04).
>> What OS are you running for this ?
>>
>> ++ fat
>>
>
>
> CentOS 6.2 using PHP 5.4.3 RPMS from Remi.
> I'll set up a test environment that's public and send more info.
>
>
Re: FPM Chroot and corrupt timezone fatal error
July 29, 2012 11:50AM
Jerome,
I've tried this on CentOS 6.3, and Ubuntu 12.04. On both I get the error

Fatal error: date(): Timezone database is corrupt - this should *never* happen! in /test.php on line 8

The nginx config for the virtual host is here

https://gist.github.com/3199552

The php.defaults it wants is here

https://gist.github.com/3199643

I used the default www.conf as it comes with the RPMs. With the only modification being setting the chroot

chroot = /var/www/html

The test script is here: https://gist.github.com/3199578 due to the fatal error, phpinfo() never runs.

And here's the output..

https://gist.github.com/3199602
Re: FPM Chroot and corrupt timezone fatal error
July 29, 2012 12:02PM
Jerome,
I've tried this on CentOS 6.3, and Ubuntu 12.04. On both I get the error

Fatal error: date(): Timezone database is corrupt - this should *never*
happen! in /test.php on line 8

The nginx config for the virtual host is here

https://gist.github.com/3199552

The php.defaults it wants is here

https://gist.github.com/3199643

I used the default www.conf as it comes with the RPMs. With the only
modification being setting the chroot

chroot = /var/www/html

The test script is here: https://gist.github.com/3199578 due to the fatal
error, phpinfo() never runs.

And here's the output..

https://gist.github.com/3199602


On Tue, May 29, 2012 at 3:03 PM, Vid Luther <vid@zippykid.com> wrote:

> On Tue, May 29, 2012 at 12:17 PM, Jérôme Loyet <ml@fatbsd.com> wrote:
>
>>
>>
>> I've just tried to create a simple chroot pool and the date function
>> is working like a charm' on my developement linux box (ubuntu 11.04).
>> What OS are you running for this ?
>>
>> ++ fat
>>
>
>
> CentOS 6.2 using PHP 5.4.3 RPMS from Remi.
> I'll set up a test environment that's public and send more info.
>
>


--
Vid Luther
CEO and Founder
ZippyKid
Managed Wordpress Hosting
http://zippykid.com/
210-789-0369
Re: FPM Chroot and corrupt timezone fatal error
December 24, 2012 10:00PM
Vid, did you ever figure out this issue?

I'm facing the same problem. I found this on a Dutch website I translated to English:

...some versions of Debian (and almost all versions of Ubuntu) have a patch which ensures that the time zone database from the OS itself is used. (Stupidity at its best, several people have already complained about). And because at a different location (/ var / share if I remember correctly), can PHP him in chroot mode, not read. Normally the time zone db embeded, so no separate file. You have a chance if you try to use FileInfo you encounter a similar problem starting. Given that a single file to read (normal behavior incidentally). therefore chroot not always convenient. But there is no way to specify multiple locations that may be accessed from the chroot? Edit: Yeah so

Lees meer: mod_ruid nieuwe ontwikkelingen - Pagina 4 http://www.webhostingtalk.nl/scripting-en-programmeren/153510-mod_ruid-nieuwe-ontwikkelingen-4.html#ixzz2G1oLSH75

But there was never any discussion of a solution.
Re: FPM Chroot and corrupt timezone fatal error
December 24, 2012 11:18PM
Well I found the answer myself. You have to copy all the files from /usr/share/zoneinfo to the chrooted folder. Then everything should work fine. It worked for me anyway.

Some people might need to make a hard link to /etc/localtime, but I didn't need to do that.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready