OS2World OLD-STATIC-BACKUP Forum

OS/2 - Technical => Web applications => Topic started by: RobertM on 2009.09.05, 06:20:40

Title: Apache, PHP and Timezones
Post by: RobertM on 2009.09.05, 06:20:40
Hey all,

Most of you may never have run into this - but I just did, and figured I would pass it along in case it would help someone else.

I've got a WAMP setup on my system, that among other things (Typo3, Joomla, WordPress, SMF) I use to query Amazon AWS for product information. AWS requests are time sensitive. Thus, for me, it would not work unless I set my clock 4 hours ahead.

Here's why. PHP (and/or Apache) with the timezone properly set in php.ini were getting confused because of the TZ string format in eCS's config.sys file.

The format (for compatibility with PHP) apparently should not be:
SET TZ=PST8PDT,3,2,0,7200,11,1,0,7200,3600

But instead should be:
SET TZ=PST8PDT

Note: Of course, substitute for your correct timezone... mine actually should read EST5EDT

More hints & info here (PHP is not the only thing affected by this):
http://www.deltasys.org/ecsindex.html

For those of you making time sensitive PHP requests to other servers, hopefully this will help.

Best,
Rob
Title: Re: Apache, PHP and Timezones
Post by: Ben on 2009.09.05, 17:29:41
Hey.

Thanks for the heads-up.

I'll give that a try.
Title: Re: Apache, PHP and Timezones
Post by: Andi on 2009.09.07, 17:36:48
The additional settings in eComStation are needed for 'daylight saving time' changes AFAIK. Probably you do not need it if you get the actual time from a time server or simply never want to let eCS change DST by itself.

Michal explained this in the OpenWatcom bug tracker (http://bugzilla.openwatcom.org/show_bug.cgi?id=834). If you encounter such problems maybe it depends on the compiler which is used for your app. If you use Pauls builds it does not hurt to ask him about that.

I wonder if these additional settings are even there if you deselect the option in the eCS installer.
Title: Re: Apache, PHP and Timezones
Post by: RobertM on 2009.12.04, 00:07:12
Interesting thing... for some reason, my TZ variable was reset to the original (which made my PHP/Amazon AWS stuff stop working again)... I thought I had disabled the eCS clock program, but I guess I need to doublecheck that, as I am guessing that may be the cause.

-Rob
Title: Re: Apache, PHP and Timezones
Post by: RobertM on 2009.12.10, 04:31:16
Quote from: RobertM on 2009.12.04, 00:07:12
Interesting thing... for some reason, my TZ variable was reset to the original (which made my PHP/Amazon AWS stuff stop working again)... I thought I had disabled the eCS clock program, but I guess I need to doublecheck that, as I am guessing that may be the cause.

-Rob

The CLKBASIC.EXE RUN statement in the config.sys file needs to be disabled to allow the timezone to not be changed to something that does not work with Apache.
Title: Re: Apache, PHP and Timezones
Post by: Andi on 2009.12.10, 13:48:48
IIRC there is a check box in one of the eCS clock settings which is labeled something like 'allow to change config.sys'. Wonder if this would have cured your problem too.