Ubuntu 16.04 Release with Zoneminder 1.29.0

Forum for questions and support relating to the 1.29.x releases only.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

iconnor wrote:You havn't set the timezone is the right php.ini file. Normally the one you need to edit is /etc/php/apache2/php.ini
For Ubuntu 16.04 it is: nano /etc/php/7.0/apache2/php.ini


With that said it may be different if you have done an upgrade. However, I have not successfully upgraded a running ZM Ubuntu install to 16.04 since the official release. Am having issues with MySQL going from 5.5 (14.04) or 5.6 (15.10) to 5.7 (16.04). Will get it to work in time...
Sigge
Posts: 116
Joined: Mon May 02, 2016 8:14 am

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by Sigge »

Hi and thanks for the instructions.

I ran in to a lot of trubble from anouther service blocking the install of mysql. Solved that but I am now unable to start apache2.

Anyone knows what the problem is? PHP not properly installed?

Log:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since lun 2016-05-02 09:57:47 CEST; 6min ago
Docs: man:systemd-sysv-generator(8)
Process: 1225 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

mag 02 09:57:47 BERTILIT apache2[1225]: * The apache2 configtest failed.
mag 02 09:57:47 BERTILIT apache2[1225]: Output of config test was:
mag 02 09:57:47 BERTILIT apache2[1225]: AH00526: Syntax error on line 11 of /etc/apache2/conf-enabled/zoneminder.conf:
mag 02 09:57:47 BERTILIT apache2[1225]: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration
mag 02 09:57:47 BERTILIT apache2[1225]: Action 'configtest' failed.
mag 02 09:57:47 BERTILIT apache2[1225]: The Apache error log may have more information.
mag 02 09:57:47 BERTILIT systemd[1]: apache2.service: Control process exited, code=exited status=1
mag 02 09:57:47 BERTILIT systemd[1]: Failed to start LSB: Apache2 web server.
mag 02 09:57:47 BERTILIT systemd[1]: apache2.service: Unit entered failed state.
mag 02 09:57:47 BERTILIT systemd[1]: apache2.service: Failed with result 'exit-code'.

Thanks!
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by SteveGilvarry »

sudo apt-get install libapache2-mod-php
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Sigge
Posts: 116
Joined: Mon May 02, 2016 8:14 am

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by Sigge »

Thanks but it did not work:

libapache2-mod-php is already the newest version (1:7.0+35ubuntu6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
User avatar
MJN
Posts: 251
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by MJN »

You might need to enable it:

Code: Select all

sudo a2enmod php

(Might need to check the 'php' descriptor - I'm not at my machine right now to check the exact name)
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by SteveGilvarry »

Is it enabled? That error is saying it doesn't understand php_flag, which is a perfectly legitimate command in zoneminder.conf if php module is loaded.

apachectl -M should see php7_module in the list.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by SteveGilvarry »

Once you get it working, i.e. you know php is loaded and working, then delete this line

Code: Select all

php_flag register_globals off
from zoneminder.conf. It is deprecated in PHP 5.4, that is register_globals is always off.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

I've just gotten an upgrade from Ubuntu 14.04 - ZM 1.29.0 to 16.04 - 1.29.0 to work. Folks, it was not pretty! I need to do it again to document the steps. I, too, had a problem with the php_flag... which I'll tell you how to fix when I get it written up.

bb
Sigge
Posts: 116
Joined: Mon May 02, 2016 8:14 am

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by Sigge »

Commenting it away makes the apache2 server start.

But localhost/zm is blank.

I created a /var/www/html/info.php conaining:

<?php
phpinfo();
?>

and that is blanc as well.

I think there is some problem with PHP?

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

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

Sigge wrote:Commenting it away makes the apache2 server start.

But localhost/zm is blank.

I created a /var/www/html/info.php conaining:

<?php
phpinfo();
?>

and that is blanc as well.

I think there is some problem with PHP?

Thanks,
Did you try to do an upgrade? If so you will have issues which I am working on.

If you did a fresh install of Ubuntu 16.04 these instructions work: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by SteveGilvarry »

You literally did the last thing I suggested, I did say once you get it working then you can comment it out.

apachectl -M and check if any php entries listed.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Sigge
Posts: 116
Joined: Mon May 02, 2016 8:14 am

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by Sigge »

@SteveGilvary: I did all but apachectl -M did not work with apache down.

Now:

apachectl -M
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgid_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_event_module (shared)
negotiation_module (shared)
rewrite_module (shared)
setenvif_module (shared)
status_module (shared)

No php?
User avatar
MJN
Posts: 251
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by MJN »

Did you enable it?
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

Upgrade procedure for Ubuntu 14.04 - ZM 1.29.0 to Ubuntu 16.04 - ZM 1.29.0 is ready. See:
https://wiki.zoneminder.com/Common_Issu ... untu_16.04
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Ubuntu 16.04 Release with Zoneminder 1.29.0

Post by bbunge »

If your Apache2 is having problems starting in Ubuntu 16.04 with a php_flag error, check that all the required PHP programs are installed:

apt-get install php php-gd libapache2-mod-php php7.0-mysql

You will also need to set your timezone in /etc/php/7.0/apache2/php.ini
Locked