Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mindeffects opened this issue Feb 5, 2015 · 9 comments
Open

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

mindeffects opened this issue Feb 5, 2015 · 9 comments

Comments

@mindeffects
Copy link
Contributor

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
Copy link

Mark-H commented Feb 6, 2015

@mindeffects
Copy link
Contributor Author

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
Copy link

Mark-H commented Feb 6, 2015

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" [email protected]:

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
#57.

@mindeffects
Copy link
Contributor Author

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
Copy link

Mark-H commented Feb 6, 2015

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" <
[email protected]>:

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
#57 (comment)
.

@pbowyer
Copy link

pbowyer commented Feb 6, 2015

Leave it as a fact of life @mindeffects 😉

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
Copy link

wuuti commented Feb 6, 2015

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
Copy link

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

@wuuti
Copy link

wuuti commented Feb 8, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants