Timezone error

Forum for questions and support relating to 1.33.x development only.
Post Reply
racelife
Posts: 78
Joined: Mon Mar 22, 2010 11:38 pm

Timezone error

Post by racelife » Sat Oct 19, 2019 8:47 pm

I just did a new install ubuntu 18.04 via the easy way script I just changed the ppa from zoneminder-1.32 to zoneminder-master and I'm getting an error:

Code: Select all

ZoneMinder is not installed properly: php's date.timezone +0000 does not match the system timezone -0600!
So I assume I need to update a php file somewhere but which one?
Here is the output of the following

Code: Select all

root@*********:/etc# sudo grep -r date.timezone ./
./php/7.2/cli/php.ini:; http://php.net/date.timezone
./php/7.2/cli/php.ini:;date.timezone =
./php/7.2/apache2/php.ini:; http://php.net/date.timezone
./php/7.2/apache2/php.ini:;date.timezone =
./php/7.2/apache2/php.ini:date.timezone = America/Denver
/etc/php/7.2/apache2/php.ini

Code: Select all

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

; http://php.net/date.default-longitude
;date.default_longitude = 35.2333

; http://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.583333

; http://php.net/date.sunset-zenith
;date.sunset_zenith = 90.583333
/etc/php/7.2/cli/php.ini

Code: Select all

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

; http://php.net/date.default-longitude
;date.default_longitude = 35.2333

; http://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.583333

; http://php.net/date.sunset-zenith
;date.sunset_zenith = 90.583333
Also in the easy way script other than changing the ppa is there anything else I should change for future installs? right now I am just testing with vm's till I get it right and running the best it can.

This is the script as I used it:

Code: Select all

#!/bin/sh
clear
read -p "This script installs Zoneminder 1.32.x on Ubuntu 18.04 AMD64 with LAMP (MySQL) installed...
Press Enter to continue or Ctrl + c to quit" nothing
clear
read -p "You must be logged in as root using sudo su ...
Press Enter to continue or Ctrl + c to quit" nothing
clear
read -p "Next we will add the PPA repository, install and configure the system to run Zoneminder. 
Press enter to continue" nothing
apt install -y software-properties-common
clear
add-apt-repository ppa:iconnor/zoneminder-master
apt update
clear
awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini
clear
apt install -y zoneminder
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enconf zoneminder
a2enmod rewrite
chown -R www-data:www-data /usr/share/zoneminder/
service apache2 reload
clear
read -p "Install complete.Press enter to continue" nothing
clear

bbunge
Posts: 2660
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Timezone error

Post by bbunge » Sun Oct 20, 2019 2:15 am

The script pulls the timezone from the OS and apends the php.ini file. Manual install has you edit the php.ini with nano and search for date. Then add your timezone. Plenty of examples in the wiki.
I ran that script yesterday, modifying for master ppa, on a fresh Bionic server with no issues. Possible your vm install of Bionic did not work right?

racelife
Posts: 78
Joined: Mon Mar 22, 2010 11:38 pm

Re: Timezone error

Post by racelife » Sun Oct 20, 2019 6:14 am

Just nuked the vm and did everything again and same error. I added the timezone in the apache2/php and cli/php still no luck.

bbunge
Posts: 2660
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Timezone error

Post by bbunge » Sun Oct 20, 2019 11:55 am

This is the line in the script that fills the timezone


awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini

Check the file /etc/timezone to make sure it is correct for your area.
Next check /etc/php/7.2/apache2/php.ini at the very end of the file for the date.timezone = entry and correct if needed.

User avatar
iconnor
Posts: 1129
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Timezone error

Post by iconnor » Sun Oct 20, 2019 3:34 pm

Guys I moved the timezone setting into options. SO now you can set it from the UI. Options->System->Timezone.

racelife
Posts: 78
Joined: Mon Mar 22, 2010 11:38 pm

Re: Timezone error

Post by racelife » Sun Oct 20, 2019 3:42 pm

bbunge wrote:
Sun Oct 20, 2019 11:55 am
This is the line in the script that fills the timezone


awk '$0="date.timezone = "$0' /etc/timezone >> /etc/php/7.2/apache2/php.ini

Check the file /etc/timezone to make sure it is correct for your area.
Next check /etc/php/7.2/apache2/php.ini at the very end of the file for the date.timezone = entry and correct if needed.
Yep did all that. Still didn't work.
iconnor wrote:
Sun Oct 20, 2019 3:34 pm
Guys I moved the timezone setting into options. SO now you can set it from the UI. Options->System->Timezone.
Excellent 👍 I'll take a look when I get home

rockedge
Posts: 1142
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: Timezone error

Post by rockedge » Mon Oct 21, 2019 2:03 am

silly question really, was the Apache server restarted after any modification to the php.ini?

possibly run

Code: Select all

<?
phpinfo();
?>
and insure that you are modifying the php.ini that is being read.

just double checking

racelife
Posts: 78
Joined: Mon Mar 22, 2010 11:38 pm

Re: Timezone error

Post by racelife » Mon Oct 21, 2019 3:54 am

Yep. I also restarted the machine after every change. But as mentioned above it is now in the UI

yaronimo
Posts: 1
Joined: Fri Oct 25, 2019 8:48 am

Re: Timezone error

Post by yaronimo » Fri Oct 25, 2019 9:03 am

iconnor wrote:
Sun Oct 20, 2019 3:34 pm
Guys I moved the timezone setting into options. SO now you can set it from the UI. Options->System->Timezone.
Thanks! Problem solved (in my case).
I could not see the live monitors using a browser on my computer but using zmninja on my cell phone I had no problem.
Does it mean that the timezone value has no effect on zmninja ?

Is the timezone value inside options/system a new feature?
I couldn't find it elsewhere but it is definitely the solution to the authentication errors that were shown in the logs.

User avatar
asker
Posts: 1252
Joined: Sun Mar 01, 2015 12:12 pm

Re: Timezone error

Post by asker » Fri Oct 25, 2019 11:39 am

yaronimo wrote:
Fri Oct 25, 2019 9:03 am
Does it mean that the timezone value has no effect on zmninja ?
If you don't set the new timezone option in ZM correctly, zmNinja should show wrong timestamps when browsing events (because the timezone API will return UTC).
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests