bibliocoll / JournalTouch

JournalTouch provides a touch-optimized interface for browsing current journal tables of contents in Responsive Design. Fun!
15 stars 11 forks source link

addition to documentation? #74

Open realsobek opened 8 years ago

realsobek commented 8 years ago

Maybe this is CentOS specific. Maybe this is useful for the documentation? I do not know what you stance on this is.

I am using JournalTouch 0.4.1 on CentOS 7 x86_64 with centos-release-scl package in order to be able to use PHP 5.5.

I installed the packages: php55 php55-php php55-php-mbstring

After installation of JournalTouch I encountered the problem: http://journaltouch/ is completely white, nothing is displayed

In the log file: /var/log/httpd24/error_log the output was: [Sun Apr 03 13:40:58.473656 2016] [:error] [pid 2487] [client 192.168.2.101:50565] PHP Warning: date(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/bibliocoll-JournalTouch-0.3-197-g27ce9e6/sys/class.ListJournals.php on line 99 [Sun Apr 03 13:40:58.474289 2016] [:error] [pid 2487] [client 192.168.2.101:50565] PHP Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /var/www/html/bibliocoll-JournalTouch-0.3-197-g27ce9e6/sys/class.ListJournals.php:101\nStack trace:\n#0 /var/www/html/bibliocoll-JournalTouch-0.3-197-g27ce9e6/sys/class.ListJournals.php(101): DateTime->__construct()\n#1 /var/www/html/bibliocoll-JournalTouch-0.3-197-g27ce9e6/sys/class.ListJournals.php(291): ListJournals->isCurrent('2014-04-28', '0001-6918')\n#2 /var/www/html/bibliocoll-JournalTouch-0.3-197-g27ce9e6/index.php(60): ListJournals->getJournals()\n#3 {main}\n thrown in /var/www/html/bibliocoll-JournalTouch-0.3-197-g27ce9e6/sys/class.ListJournals.php on line 101

The solution was to explicitely set time zone in PHP config file with: sed -i 's#;date.timezone =#date.timezone = Europe/Berlin#' "/opt/rh/php55/root/etc/php.ini"

Restart of httpd required: systemctl restart httpd24-httpd.service

krugar commented 8 years ago

if noone objects, i would keep this hardcoded to UTC for 0.4.* 0.5 will likely see changes in that area and i don't really want to touch this twice in a row.

related: i wouldn't mind making timeago state "today" for dates less than 24h in the past, sub-day resolution seems kinda moot here since the time mentioned in the UI usually is the last time the cron job ran and not the precise time the journal was released.

realsobek commented 8 years ago

after upgrade to 0.4.2 on CentOS 7 explicitely setting time zone in PHP config /opt/rh/php55/root/etc/php.ini is not required to make http://journaltouch/ display. However, when you visit it tail -f /var/log/httpd24/error_log prints:

[:error] [pid 10826] [client 141.14.232.146:33010] 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /opt/rh/httpd24/root/var/www/html/bibliocoll-JournalTouch-0.4.2-0-ga5da414/sys/class.ListJournals.php on line 98, referer: http://journaltouch.mpikg.mpg.de/admin/settings.php
[:error] [pid 10826] [client 141.14.232.146:33010] 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /opt/rh/httpd24/root/var/www/html/bibliocoll-JournalTouch-0.4.2-0-ga5da414/sys/class.ListJournals.php on line 99, referer: http://journaltouch.mpikg.mpg.de/admin/settings.php
[:error] [pid 10826] [client 141.14.232.146:33010] PHP Warning:  date(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /opt/rh/httpd24/root/var/www/html/bibliocoll-JournalTouch-0.4.2-0-ga5da414/sys/class.ListJournals.php on line 99, referer: http://journaltouch.mpikg.mpg.de/admin/settings.php

note: deleted multiple repetitions of above lines

[:error] [pid 10826] [client 141.14.232.146:33010] 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /opt/rh/httpd24/root/var/www/html/bibliocoll-JournalTouch-0.4.2-0-ga5da414/index.php on line 426, referer: http://journaltouch.mpikg.mpg.de/admin/settings.php

note: deleted multiple repetitions of above line

The fix is to explicitely set the time zone in PHP config file