Page 1 of 1

Timezone error

Posted: Sat Oct 19, 2019 8:47 pm
by racelife
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

Re: Timezone error

Posted: Sun Oct 20, 2019 2:15 am
by bbunge
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?

Re: Timezone error

Posted: Sun Oct 20, 2019 6:14 am
by racelife
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.

Re: Timezone error

Posted: Sun Oct 20, 2019 11:55 am
by bbunge
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.

Re: Timezone error

Posted: Sun Oct 20, 2019 3:34 pm
by iconnor
Guys I moved the timezone setting into options. SO now you can set it from the UI. Options->System->Timezone.

Re: Timezone error

Posted: Sun Oct 20, 2019 3:42 pm
by racelife
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

Re: Timezone error

Posted: Mon Oct 21, 2019 2:03 am
by rockedge
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

Re: Timezone error

Posted: Mon Oct 21, 2019 3:54 am
by racelife
Yep. I also restarted the machine after every change. But as mentioned above it is now in the UI

Re: Timezone error

Posted: Fri Oct 25, 2019 9:03 am
by yaronimo
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.

Re: Timezone error

Posted: Fri Oct 25, 2019 11:39 am
by asker
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).