You are not logged in.

#1 2006-12-28 19:57:49

T-u-N-i-X
Member
From: İstanbul
Registered: 2006-03-14
Posts: 435
Website

PHP Problem - Please Help..!

Hello,

I've set a LAMP on my Arch Linux computer.. It's an old P3 733 Mhz (128 MB SD RAM) computer..

Anyway, i create a simple PHP script  that only contains:

----

echo date("l");

----

But it prints the error message:

Fatal error: date() [<a href='function.date'>function.date</a>]: Timezone database is corrupt - this should *never* happen! in /home/tunix/public_html/deneme.php on line 1

Please help me..


Quis custodiet ipsos custodiet?

Offline

#2 2006-12-29 00:09:24

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: PHP Problem - Please Help..!

when you type 'date' on the command line, what do you get?
also, make sure you ran though the locale-gen stuff


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2006-12-29 00:42:03

T-u-N-i-X
Member
From: İstanbul
Registered: 2006-03-14
Posts: 435
Website

Re: PHP Problem - Please Help..!

[02:41] (tunix@penguix ~)$ date
Cum Ara 29 02:41:45 EET 2006

[02:41] (tunix@penguix ~)$ sudo locale-gen
Generating locales...
  tr_TR.UTF-8... done
Generation complete.


Quis custodiet ipsos custodiet?

Offline

#4 2006-12-29 11:43:22

T-u-N-i-X
Member
From: İstanbul
Registered: 2006-03-14
Posts: 435
Website

Re: PHP Problem - Please Help..!

Nobody have this problem ??


Quis custodiet ipsos custodiet?

Offline

#5 2006-12-29 12:01:50

smoon
Member
Registered: 2005-08-22
Posts: 468
Website

Re: PHP Problem - Please Help..!

Have you actually tried setting the timezone in your php.ini? Something like

date.timezone = "Europe/Istanbul"

should do fine. Also check /usr/share/zoneinfo. Maybe permissions are wrong or you're missing some files there (check if you got UTC or Europe/whatever in there)?

Offline

#6 2006-12-29 17:25:34

T-u-N-i-X
Member
From: İstanbul
Registered: 2006-03-14
Posts: 435
Website

Re: PHP Problem - Please Help..!

I've allready set that.. Which permissions should I check ?

I entered a bug report about this problem.


Quis custodiet ipsos custodiet?

Offline

#7 2006-12-29 23:10:03

T-u-N-i-X
Member
From: İstanbul
Registered: 2006-03-14
Posts: 435
Website

Re: PHP Problem - Please Help..!

I just discovered that, it only occurs when I restart the httpd service by writing /etc/rc.d/httpd restart , but it doesn't occur when I restart the system completely.. Should I restart some other service ? Anybody have an idea why it happens ?


Quis custodiet ipsos custodiet?

Offline

#8 2006-12-29 23:38:44

juergen
Developer
From: Frankfurt/Germany
Registered: 2005-04-11
Posts: 48
Website

Re: PHP Problem - Please Help..!

T-u-N-i-X wrote:

I just discovered that, it only occurs when I restart the httpd service by writing /etc/rc.d/httpd restart , but it doesn't occur when I restart the system completely.. Should I restart some other service ? Anybody have an idea why it happens ?

How did you setup you default timezone?

bash-3.2$ file /etc/localtime
/etc/localtime: symbolic link to `/usr/share/zoneinfo/Europe/Berlin'

Offline

#9 2006-12-29 23:42:57

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: PHP Problem - Please Help..!

juergen wrote:
bash-3.2$ file /etc/localtime
/etc/localtime: symbolic link to `/usr/share/zoneinfo/Europe/Berlin'

Since initscripts 0.8 it should be not symbolic link, but a copy of proper file in /usr/share/zoneinfo.


to live is to die

Offline

#10 2006-12-30 02:29:47

T-u-N-i-X
Member
From: İstanbul
Registered: 2006-03-14
Posts: 435
Website

Re: PHP Problem - Please Help..!

It's a copied version of /usr/share/zoneinfo/Europe/Istanbul


Quis custodiet ipsos custodiet?

Offline

#11 2006-12-30 02:31:25

T-u-N-i-X
Member
From: İstanbul
Registered: 2006-03-14
Posts: 435
Website

Re: PHP Problem - Please Help..!

I changed my locale to C, and it started working again. I changed my locale from tr_TR.UTF-8 to tr_TR.ISO8859-9 and then it started working again.. If doesn't work only if I use tr_TR.UTF-8

So I started thinking that it's an UTF-8 problem


Quis custodiet ipsos custodiet?

Offline

#12 2006-12-30 09:46:10

juergen
Developer
From: Frankfurt/Germany
Registered: 2005-04-11
Posts: 48
Website

Re: PHP Problem - Please Help..!

T-u-N-i-X wrote:

I changed my locale to C, and it started working again. I changed my locale from tr_TR.UTF-8 to tr_TR.ISO8859-9 and then it started working again.. If doesn't work only if I use tr_TR.UTF-8

So I started thinking that it's an UTF-8 problem

This seems to be a php-bug, GNU date works fine:

bash-3.2$ TZ=Europe/Istanbul LANG=tr_TR.UTF-8 php -r 'date("l");'

Fatal error: date(): Timezone database is corrupt - this should *never* happen! in Command line code on line 1
bash-3.2$ TZ=Europe/Istanbul LANG=tr_TR.UTF-8 date +%A
Cumartesi

Offline

Board footer

Powered by FluxBB