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

Timezone issue with newer PHP versions #6

Open
mattpascoe opened this issue Jul 19, 2013 · 3 comments
Open

Timezone issue with newer PHP versions #6

mattpascoe opened this issue Jul 19, 2013 · 3 comments

Comments

@mattpascoe
Copy link
Member

I just updated my RedHat Enterprise Linux server 6 ONA server to the latest version of PHP (5.3.3-22.el6), using the latest ONA and build_bind 1.5

I keep having the following errors fill up the apache error log, and it seems unhappy about something in the build_bind module.


PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Jayapura' for 'CST/9.0/no DST' instead in /opt/ona/www/modules/build/build_bind.inc.php on line 394

I'm having to flush my logs out or it'll fill my /var to capacity, and tune PHP to show less errors.

I figure you can probably fix the issue though.

@mattpascoe
Copy link
Member Author

for now I suspect you can put a 'data.timezone' setting in the php.ini to bypass this error. Need to determine a clean way of handling this.

@jaydio
Copy link
Contributor

jaydio commented Oct 1, 2014

There's nothing to work around here since it's not an application specific issue. PHP requires the timezone to be explicitely defined since version 5.1.0. The behaviour you describe is documented here -> http://php.net/manual/en/function.date-default-timezone-set.php

Quote:

Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will
generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.

@mattpascoe
Copy link
Member Author

I'm inclined to do something like this: http://php.net/manual/en/function.date-default-timezone-set.php#113864

This way ONA will use the date_default_timezone_set function to set things properly but use a system level setting for the proper value. I don't want to have users explicitly set this in some ONA config somewhere.

Otherwise, bottom line is, people just need to configure their environment properly :)

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

2 participants