modx-ccc-2015 / whishlist

The overall repository with MODX issues to tackle together at the MODX CCC 2015. This place is ment to be as a big pond of possibilies.
0 stars 0 forks source link

Why does MODX need the PHP setting "date.timezone" to work? #57

Open mindeffects opened 9 years ago

mindeffects commented 9 years ago

Instaling MODX on a fresh system is not really much fun, When you have all those apache and other modules I place, you get a slap by the setup for not having set a value for "date.timezone". Besides the harsh "FATAL ERROR" yell you are left alone. OK, the problem lies in the php.ini, but the system not is very helpful here. Took my quite a while to figure out was was going wrong when I first ran into that problem. I was told that "date.timezone" has to be set, because otherwise MODX would not function correctly. OK, I understand that bad things will happen, but I don't understand why. I also don't understand why other CMSes can perfectly live without a date.timezone setting and don't crumble in to peaces. Maybe it's just my lack of deeper core knowledge, but wouldn't it be better if the MODX was not depending on date.timezone? There has to be a solution for that! Can someone explain the logic behind the mandatory date.timezone-setting? I really want to understand the WHY!

Mark-H commented 9 years ago

This is php 5.3 config, not MODX. The error could be better and more useful,I agree.

Quick search:

http://forum.joomla.org/viewtopic.php?t=363681 https://wordpress.org/support/topic/php-530-amp-wp-28-it-is-not-safe-to-rely-on-the-systems-timezone https://www.drupal.org/node/691648

mindeffects commented 9 years ago

Thanks, @Mark-H. Yes, it's a malconfigured system (PHP) that causes the error, not MODX itself. But why is date.timezone so important? What does "It is not safe to rely on the system's timezone settings." mean? Not save? Why can't the system live with the "UTC" fallback?

Mark-H commented 9 years ago

Also:

http://stackoverflow.com/questions/22785828/why-does-php-think-its-a-bad-idea-to-rely-on-the-systems-time-zone And http://stackoverflow.com/questions/11747709/php-5-4-cant-determine-time-zones-on-its-own Op 6 feb. 2015 01:05 schreef "Mark Hamstra" hamstra.mark@gmail.com:

This is php 5.3 config, not MODX. The error could be better and more useful,I agree.

Quick search:

http://forum.joomla.org/viewtopic.php?t=363681>forum.joomla.org https://wordpress.org/support/topic/php-530-amp-wp-28-it-is-not-safe-to-rely-on-the-systems-timezone https://www.drupal.org/node/691648

Instaling MODX on a fresh system is not really much fun, When you have all those apache and other modules I place, you get a slap by the setup for not having set a value for "date.timezone". Besides the harsh "FATAL ERROR" yell you are left alone. OK, the problem lies in the php.ini, but the system not is very helpful here. Took my quite a while to figure out was was going wrong when I first ran into that problem. I was told that "date.timezone" has to be set, because otherwise MODX would not function correctly. OK, I understand that bad things will happen, but I don't understand why. I also don't understand why other CMSes can perfectly live without a date.timezone setting and don't crumble in to peaces. Maybe it's just my lack of deeper core knowledge, but wouldn't it be better if the MODX was not depending on date.timezone? There has to be a solution for that! Can someone explain the logic behind the mandatory date.timezone-setting? I really want to understand the WHY!

— Reply to this email directly or view it on GitHub https://github.com/modx-ccc-2015/whishlist/issues/57.

mindeffects commented 9 years ago

I just try to imagine a webserver on a plane doing international flights. :-) So prior to PHP 5.4 life was better or worse? Damn. My eyes are starting to hibernate. :-D See you in Cologne tomorrow!

Mark-H commented 9 years ago

Many things subtly rely on proper timezones. Everything from profiling query time internally to displaying a published date.

More obviously if the server is configured to display errors (given the server is configured without timezone, personally I think that's a likely scenario), the manager will be utterly broken. There will be errors about it in every bit of the markup which will break the display and potentially extjs, ajax responses (of which there are many) will break because it has errors where it should be pure json etc. Op 6 feb. 2015 01:36 schreef "Oliver Haase-Lobinger" < notifications@github.com>:

I just try to imagine a webserver on a plane doing international flights. :-) So prior to PHP 5.4 life was better or worse? Damn. My eyes are starting to hibernate. :-D See you in Cologne tomorrow!

— Reply to this email directly or view it on GitHub https://github.com/modx-ccc-2015/whishlist/issues/57#issuecomment-73160259 .

pbowyer commented 9 years ago

Leave it as a fact of life @mindeffects :wink:

I guess it's better than the alternative of PHP shipping with a default timezone of EST and then new users wondering why it's wrong (though I do wonder why it can't just use the server' timezone by default)

wuuti commented 9 years ago

Read only a few of Marks links... but I still don't understand why we do not set the timezone in setup and core with date_default_timezone_set('UTC'); or something like that if it is not already set. Afterwards a user may overwrite that with a system setting. Would'nt this make the setup and the final installed system independent from ini or server settings? Correct me please...

bequadrat commented 9 years ago

I agree with @inreti – this would be way better than the current fatal error, especially for technically less experienced users.

wuuti commented 9 years ago

:-( ohhh... we have not talked about this issue... damn...