Koozali.org: home of the SME Server

Timezone database is corrupt - this should *never* happen!

Offline bordr415

  • *
  • 18
  • +0/-0
Timezone database is corrupt - this should *never* happen!
« on: April 01, 2009, 01:35:19 PM »
Ok, I know that officially its not supported, but everytime I try to open a particular site with a time tracking software it fails with an error:
 Fatal error: mktime() [<a href='function.mktime'>function.mktime</a>]: Timezone database is corrupt - this should *never* happen! in /home/e-smith/files/ibays/timesheet/html/calendar.php on line 46.

This error is beyond frustrating by the way.

I am not new nor am I an experienced linux user. But all the solutions I find are related to something in the way they changed the Timezone settings from earlier versions. They all say to edit php.ini or change rights to certain files (which I can't remember right now). The second I have tried (opened the file up to read write access to everyone and still no go.)

Here's the big dilemma. My timetracking software runs great on PHP v4.x (and PHP v5.x in ubuntu, debian, etc.) but does not run on PHP v5 (in sme). My other invoicing software does not run on PHP v4.x and requires PHP v5.x. I had all of this in an Ubuntu server box and had to migrate to this particular setup as the Ubuntu box just wasn't secure... Seemed like every week someone was finding a way in. They by default had left too many things open. I like the security of this server. I just need to figure out how to get past this...

bordr

Thanks in advance and if you need any more info, let me know.
« Last Edit: April 01, 2009, 02:38:29 PM by bordr415 »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #1 on: April 01, 2009, 04:58:32 PM »
My timetracking software runs great on PHP v4.x (and PHP v5.x in ubuntu, debian, etc.) but does not run on PHP v5 (in sme).

SME server does not include PHP5, so this thread is off-topic for this forum, whose subject is:

Quote
Discussion of the use of *ONLY* the components and features included on the SME Server 7.x CD.

I think it's reasonable to conclude that either the timezone database is corrupt, or your PHP installation is broken. I think the latter is more likely.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Timezone database is corrupt - this should *never* happen!
« Reply #2 on: April 01, 2009, 08:06:34 PM »
Moving this thread to General Discussion as it is more appropriate there.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline bordr415

  • *
  • 18
  • +0/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #3 on: April 02, 2009, 07:27:58 AM »
it only occurs on sme not on any other distro. it even occurs on the 8.0b3 edition.

I had originally posted this where it belongs in the 7.4 section as that is what I'm running. I am just trying to find a solution to make both applications run.

As I stated before the change in php v5.1.x changed from a separate timezone file to the local timezone located in the php.ini. This is to prevent errors from updates. I understand how this works. I also realize that PHP5 is not included in the 7.4 release of SME but since most programs are written in php5+ now its difficult to limit a server to php4.

My only solution is to try to use 7.4 and update php. As the beta edition of 8.0 has a lot of problems! I'm just not sure how to edit the timezone settings in php.ini without screwing up the templates section or without being re-written by the templates.

SME server does not include PHP5, so this thread is off-topic for this forum, whose subject is:

I think it's reasonable to conclude that either the timezone database is corrupt, or your PHP installation is broken. I think the latter is more likely.


CharlieBrady: And this helps how?
All other php functions work fine, just the date and time problem. (which by the way is a big problem)

Not trying to be rude guys, but I have made one post and got slammed 2x with posts that have no relevance to my problem.

Cactus while i recognize you have the authority to "move a post to the general section" why are you so obtuse with the people that are asking for help. Not trying to be rude, but if someone needs help they are asking for it, not for ridicule. I only say that as a checked on your last 5 posts and all of them have a very negative demeanor.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #4 on: April 02, 2009, 02:16:46 PM »
My only solution is to try to use 7.4 and update php.

Your updated php seems to have a problem.

Quote
As the beta edition of 8.0 has a lot of problems!

Please ensure that those problems are reported via the bug tracker.

Quote
I'm just not sure how to edit the timezone settings in php.ini without screwing up the templates section or without being re-written by the templates.

Search on this site for "custom templates".

Offline bordr415

  • *
  • 18
  • +0/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #5 on: April 02, 2009, 03:19:51 PM »
I have found nothing in regards to the timezone setting in php.ini in any of the templates or on any searches. In the forums there are a few things that come up but nothing that answers my question.

This problem is related to something in CentOS as google searches reveal this.

Search where? The wiki, forums, howtos as I have already searched these... Sorry, the layout of this site is difficult to locate information from.


Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #6 on: April 02, 2009, 03:37:57 PM »
http://www.electrictoolbox.com/correct-php-timezone/

30 seconds search with google "timezone database php centos problem" :-)

HTH

ciao
Stefano

Offline bordr415

  • *
  • 18
  • +0/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #7 on: April 03, 2009, 12:53:56 PM »
I have done everything listed on that page already. Even added the second part about editing php.ini...
« Last Edit: April 03, 2009, 01:40:05 PM by bordr415 »

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Timezone database is corrupt - this should *never* happen!
« Reply #8 on: April 03, 2009, 01:01:48 PM »
ok, and once again if i change the php.ini file it gets over-ridden from the templates (according to what i've read)
True, the file is templated just as almost any other configuration file on SME Server. More on the template system can be read in the SME Server Developers Guide linked in the wiki.

In short your solution is this:

1. Locate the template fragment you need to edit in /etc/e-smith/templates/etc/php.ini/, but do not edit that one.
2. Recreate the same directory structure below /etc/e-smith/templates-custom/ as you found in /etc/e-smith/templates/, if you have made previous modifications it might already exits, if not this command will create it:
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/php.ini3. Now copy the fragment you would like to modify from the templates tree to the templates-custom tree (respecting the directory structure):
Code: [Select]
cp /etc/e-smith/templates/etc/php.ini/name-of-fragment /etc/e-smith/templates-custom/etc/php.ini/4. Now edit the copied fragment with your favorite editor, after you have made your modifications save them.
5. Now we need to regenerate the configuration file and reload it, this can most easlily be done using the followin:
Code: [Select]
signal-event remoteaccess-update
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline bordr415

  • *
  • 18
  • +0/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #9 on: April 03, 2009, 01:57:44 PM »
I'm lost on step 1: Locate the template fragment?

Maybe I can go about this another way:

Can someone give me a quick step by step in code on how to change php.ini to include this:

[DATE]
date.timezone = America/Los_Angelas


I can reverse engineer it, but as of right now I'm not understanding the fragment directions.
You'll have to excuse my slowness on account I am usually dealing with MS and am trying to migrate many locations to open source. I believe that SME is quite capable (mostly the Ibays) of handling everything most of my clients will need.

Cactus I appreciate the help. (may not understand the directions but atleast I'm getting somewhere  :???:)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #10 on: April 03, 2009, 02:11:13 PM »
to locate the template fragment, go to /etc/e-smith/templates-custom/etc/php.ini

if [date] directive doesn't appear in any of php.ini fragments, then create your own in /templates-custom/ tree and give it the name you prefer

follow cactu's directives

in any case, in developer manual you'll find everything about SME's templating system

HTH
Ciao
Stefano

Offline bordr415

  • *
  • 18
  • +0/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #11 on: April 03, 2009, 02:18:32 PM »
/etc/e-smith/templates-custom/etc/php.ini returns:
-bash: /etc/e-smith/templates-custom/etc/php.ini: is a directory
vi /etc/e-smith/templates-custom/etc/php.ini returns:
"/etc/e-smith/templates-custom/etc/php.ini" is a directory

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #12 on: April 03, 2009, 02:24:45 PM »
bordr415:

not to be rude but:
- did you read cactus' post?
- did you read dev. manual?
- did you try to search the forum for "custom template"?

/etc/e-smith/templates-custom/etc/php.ini  is a directory.. so you have do cd to that one and copy/create the fragment..

Code: [Select]
cd /etc/e-smith/templates-custom/etc/php.ini

if fragment exists in /etc/e-smith/templates/etc/php.ini directory then follow cactus' instructions, otherwise, follow mine.

is it so difficult to READ?

Ciao
Stefano

Offline David Harper

  • *
  • 653
  • +0/-0
  • Watch this space
    • Workgroup Technology Solutions
Re: Timezone database is corrupt - this should *never* happen!
« Reply #13 on: April 03, 2009, 02:39:28 PM »
@bordr415 - just elaborating on Stefano's post a little...

While you may know a bit about how Linux works, it would do you good to read the manual more carefully (and twice would be good). SME Server aims to simplify common tasks and also tries very hard to protect the system configuration during upgrades, both minor and major. These goals are met by using an architecture that is unlike any other Linux distro; the problems you are running into reflect that (IMHO) you haven't taken the time to appreciate this.

As has been suggested, you should read the Developer's Manual more carefully before you go poking around too much.

Also, please bear in mind that Contribs.org isn't backed by some large corporation with a huge payroll. Everyone here is basically a volunteer. So take the time to appreciate the fact that anyone is helping you at all. If this were a Windows server you'd be paying Microsoft and/or some consulting company a couple hundred bucks an hour - at least - to assist you with a problem like this.

Lastly, if you think that there is a problem, there's not much point complaining about it here in the forums. Use the bug tracker: that's where the developers pay attention. It's not clear to me exactly what it is causing this issue, but it sounds like it's possible that our templates need to be updated to deal with time zones for whatever software you are using. So if you could file a report with the error and the software affected, something might happen to fix this for the benefit of all members.

Offline bordr415

  • *
  • 18
  • +0/-0
Re: Timezone database is corrupt - this should *never* happen!
« Reply #14 on: April 03, 2009, 02:40:24 PM »
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/php.ini
Code: [Select]
cp /etc/e-smith/templates/etc/php.ini/name-of-fragment /etc/e-smith/templates-custom/etc/php.ini/

Not understanding the "name-of-fragment" section. AND YES I HAVE BEEN READING FOR 2+ days now, non stop on this issue. Have even created virtual machines to temp run the different php versions until this is solved. I am re-reading the DEV Manual now. But still not understanding it. Ya i read the cactus post. but if I don't understand that part of his code then I can't make it work.

And you create a fragment how?
Maybe I can go about this another way:

Can someone give me a quick step by step in code on how to change php.ini to include this:

[DATE]
date.timezone = America/Los_Angelas

 
I will reverse engineer it to understand what is going on but as of right now everyone is telling me to do something that I admittedly don't know how to do.
As I said I have mostly dealt with MS and their command line.
I am not new nor am I an experienced linux user.