PHP Fatal error: date(): Timezone database is corrupt - this should *never* happen!

When I tried to execute a script that using date function on my Vortex, i got this error message.

"PHP Fatal error: date(): Timezone database is corrupt - this should *never* happen!".

Actually, this happened a long time ago, but only today I gave my efficient time tried to solve this problem. Luckily,I found the solution with just a few minutes.

Solution :

Make sure that web server(I'm using lighttpd on vortex) has enough access to read
/etc/localtime
/usr/share/zoneinfo

if localtime is not exist, you can copy the file from any Linux system.

2 comments:

Scott Levy said...

Fantastic post. Here’s a tool that lets your build your online database without programming. There is no need to hand code PHP. Cut your development time by 90%
http://www.caspio.com/

Unknown said...

Just an addition:
I'm using chroot, and I had to copy /etc/localtime and /usr/share/zoneinfo
and gave them appropriate permissions
inside the chroot folder i.e:
/chroot/home/etc/localtime and
/chroot/home/usr/share/zoneinfo

 
Copyright © peyotest