Enhancement #3068

Set PHP default timezone from system timezone

Added by Davide Principi over 6 years ago. Updated over 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-ntp
Target version:v6.6-rc1
Resolution: NEEDINFO:No

Description

This enhancement was previously reported as bug #3016. We must set a reasonable value for date.timezone in php.ini, in Server Manager, during the Timezone set up.

We are almost sure the value in Timezone key is accepted also by PHP, but there can be some cases where it is not. UTC is the ultimate default for such cases.


Related issues

Copied from NethServer 6 - Bug #3016: Wrong timezone in php.ini cause PHP localtime() function ... CLOSED

Associated revisions

Revision 38306509
Added by Davide Principi over 6 years ago

Event nethserver-ntp-save: expand /etc/php.ini. Refs #3068

Revision 3f0f418d
Added by Davide Principi over 6 years ago

Server Manager: use timezone settings from php.ini. Refs #3068

Revision 8c127f32
Added by Davide Principi over 6 years ago

Set php/DateTimezone prop when system timezone has been changed. Refs #3068

Revision 2cb7b28d
Added by Davide Principi over 6 years ago

Reverted changes for PHP date.timezone settings. Refs #3016 #3068

Revision bbbc0481
Added by Davide Principi over 6 years ago

Merge pull request #53 from DavidePrincipi/master

Added PHP date.timezone note for 6.6 release. Refs #3016 #3068

History

#1 Updated by Davide Principi over 6 years ago

  • Copied from Bug #3016: Wrong timezone in php.ini cause PHP localtime() function to report time different from date shell command added

#2 Updated by Davide Principi over 6 years ago

  • Category set to nethserver-ntp
  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20
  • only php.ini template expansion
  • no daemon restart

As the timezone set up occurs during post-install phase and before updates are downloaded, we don't care about httpd-admin restart here. A system reboot, or nethserver-httpd-admin-update event would fix the timezone settings in Server Manager.

#3 Updated by Davide Principi over 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

#4 Updated by Davide Principi over 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Test case 1

Change the Timezone from Date and Time page. Check the prop php/DateTimezone changes accordingly.

Test case 2

Change the Timezone from First Configuration Wizard page. Check the prop php/DateTimezone changes accordingly.

NOTE (for both cases): if the system timezone is not considered a valid PHP setting, an ERROR message is sent to /var/log/messages. If this happen the php/DateTimezone prop must be set to UTC.

#5 Updated by Davide Principi over 6 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing 6.6:
nethserver-ntp-1.0.7-2.6.g8c127f3.ns6.noarch.rpm
nethserver-httpd-admin-1.3.6-2.30.g3f0f418.ns6.noarch.rpm
nethserver-php-1.1.1-1.5.g3830650.ns6.noarch.rpm

#6 Updated by Giacomo Sanchietti over 6 years ago

  • Assignee set to Giacomo Sanchietti

#7 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

Test case 1: OK

Test case 2: OK

But I couldn't find an invalid timezone for PHP, so I can't test the default UTC value.

#8 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-base:
  • nethserver-ntp-1.0.8-1.ns6.noarch.rpm
  • nethserver-php-1.1.2-1.ns6.noarch.rpm
  • nethserver-httpd-admin-1.3.7-1.ns6.noarch.rpm

Also available in: Atom PDF