apache2 restart php error

Forum for questions and support relating to the 1.31.x releases only.
Locked
bigfoot49
Posts: 6
Joined: Sun Jul 30, 2017 1:52 pm

apache2 restart php error

Post by bigfoot49 »

Hi,

I installed zoneminder on debian (openemdiavault iso). When I try a systemctl restart I get the error:

Code: Select all

Jul 30 15:59:34 openmediavault apache2[1607]: AH00526: Syntax error on line 11 of /etc/apache2/conf-enabled/zoneminder.conf:
Jul 30 15:59:34 openmediavault apache2[1607]: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server
Jul 30 15:59:34 openmediavault apache2[1607]: Action 'configtest' failed.
Jul 30 15:59:34 openmediavault apache2[1607]: The Apache error log may have more information.
Jul 30 15:59:34 openmediavault systemd[1]: apache2.service: control process exited, code=exited status=1
Jul 30 15:59:34 openmediavault systemd[1]: Failed to start LSB: Apache2 web server.
Line 11 of the config file

Code: Select all

php_flag register_globals off

I also saw there is no /etc/php5/apache2/php.ini file on the system.

All zm deamons are running.

But no web GUI and this error.

Any idea?

Regard from Germany
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: apache2 restart php error

Post by rockedge »

Hello! I think you may have an error in the Apache installation. What directories exist in /etc/apache2?
I just installed 1.30.4 on a USB flash drive running Debian 9 "Stretch" and another USB flashdrive with Lubuntu Trusty and zoneminder 1.31.1 from the master PPA. I followed the install instructions for each version of OS and ZM exactly (copy & paste) and both work very well.

Please review your installation that all the pieces are there!

Good afternoon in Germany!
bigfoot49
Posts: 6
Joined: Sun Jul 30, 2017 1:52 pm

Re: apache2 restart php error

Post by bigfoot49 »

Code: Select all

ls /etc/apache2/
apache2.conf  conf-available  conf-enabled  envvars  magic  mods-available  mods-enabled  ports.conf  sites-available  sites-enabled
zoneminder.cfg

Code: Select all

# Remember to enable cgi mod (i.e. "a2enmod cgi").
ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    Require all granted
</Directory>

Alias /zm /usr/share/zoneminder/www
<Directory /usr/share/zoneminder/www>
#  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

Code: Select all

uname -a
Linux openmediavault 4.9.0-0.bpo.3-amd64 #1 SMP Debian 4.9.30-2~bpo8+1 (2017-06-14) x86_64 GNU/Linux
I think debian jessi.

Everything looks fine.
All files are placed correct.

Only the missing php file and the apache php error.

I can´t reinstall the whole system. So I must be carefully.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: apache2 restart php error

Post by bbunge »

I would guess that openmediavault is based on Debian 8? And i bet you did not use Zoneminder 1.31.1. Check the WIKI for the latest Debian install procedures.
bigfoot49
Posts: 6
Joined: Sun Jul 30, 2017 1:52 pm

Re: apache2 restart php error

Post by bigfoot49 »

Yes it´s Debian 8 (Jessi)
bbunge wrote: Sun Jul 30, 2017 3:05 pm And i bet you did not use Zoneminder 1.31.1.
you´re right ... it´s 1.29.0 ... sorry my mistake :|

so wrong forum...

but...after all this steps no web side and no /etc/php5/apache2/php.ini file.

strange
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: apache2 restart php error

Post by rockedge »

that is strange. I have not installed 1.29 in awhile but I am not familiar with openmediavault. Is there a directory /usr/share/zoneminder/www ??
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: apache2 restart php error

Post by bbunge »

bigfoot49
Posts: 6
Joined: Sun Jul 30, 2017 1:52 pm

Re: apache2 restart php error

Post by bigfoot49 »

sorry guys... I´m looking for a other software solution.

I installed it on a clean debian 8, a raspberry, centos7 and try all the different ways to set up.
But in all cases there where problems and errors.

With all my other server (samba, nextcloud, usv-monitoring, nagios, postfix(!), dovecot, omv ....) I had no such problems like with zoneminder...jesus...

Update:
My solution is Motioneye. Works out of the box. Not so much features like zoneminder, but easy to install, easy to config works on all platforms (also OMV ISO).
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: apache2 restart php error

Post by rockedge »

I just set up 1.30.4 on a 32 bit OS called TrinityDog which is a Debian 9 "Stretch" modified to act like a Puppy Linux using the Trinity desktop. I used these instructions and I have ZM up and running after basically copying & pasting the commands into a terminal. The OS and the ZM installation are all on an 8 gig USB flash drive. The computer is a 2005 Dell Inspiron E1505. Bummer you couldn't get ZM going. Good Luck.

snapshot2.png
snapshot2.png (566.23 KiB) Viewed 90365 times
bigfoot49
Posts: 6
Joined: Sun Jul 30, 2017 1:52 pm

Re: apache2 restart php error

Post by bigfoot49 »

rockedge wrote: Mon Jul 31, 2017 6:59 pm Bummer you couldn't get ZM going.
ohhhh.... little boy...don´t cry...here is your lollipop :lol:
rockedge wrote: Mon Jul 31, 2017 6:59 pmGood Luck.
Thank you! I don´t need luck... motioneye works.


So, lord of zoneminder...try it on openmediavault. Not Debian 9 or USB Stick or what ever ...
Don´t change the challenge!

Install openmediavault from iso (not Debian 8 with Openmediavault package), configure in openmediavault a file share (it´s easy. a bummer like me can do it in 5 minutes), then install zm without rebooting the system.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: apache2 restart php error

Post by rockedge »

I'll give motioneye a try....I haven't yet.
Ich glaube sie etwas missverstanden haben.
All I meant was too bad you didn't get it going. I will try openmediavault from iso and see what happens. I believe the OS I mentioned is developed in Deutschland.
bigfoot49
Posts: 6
Joined: Sun Jul 30, 2017 1:52 pm

Re: apache2 restart php error

Post by bigfoot49 »

OK...
For me was zoneminder the first choice. But it must work on openmediavault.

So if you get it work you must told my how :!:
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: apache2 restart php error

Post by rockedge »

Okay! I was able to get ZoneMinder 1.29.0 running on openmediavault. I setup a VirtualBox machine installation of openmediavault 3.0.89 Erasmus and got it running and can login on to the web console. The openmedia web console I set to run on Port 86. The virtual machine has an 8gig HDD and 786 megs of RAM.
The zoneminder install begins with a careful install of Apache then the mysql-server PHP5 with several added modules.
I followed most of this set of instructions https://wiki.zoneminder.com/Debian_8_64 ... e_Easy_Way
When I first tried the ZM web console would not run. the apache and php installation where flawed when I used the instructions exactly. What I did was spread out the steps using apt-get and going in this order ->
Apache
PHP5
mysql
zoneminder

I noticed on my first attempt which failed to run that the php code was not being parsed...so blank screen when trying to open the ZM web console.
I had problems with Apache config and the PHP5 config. On the second and successful attempt, I used the order listed above and used the commands from the instructions. I will build a new virtual machine and go through the steps one by one and write a guide if you think it would be a good idea.

capture12730.png
capture12730.png (448.96 KiB) Viewed 90318 times
capture13527.png
capture13527.png (666.47 KiB) Viewed 90318 times
UPDATE I tuned the machine a little and removed php5-fpm. I will attempt to upgrade ZM from 1.29 to 1.30.4 later today if time allows....
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: apache2 restart php error

Post by bbunge »

Here ya go... Zoneminder on OpenMediaVault

Install OpenMedia Vault. Log into the web interface and change the default password
Next, go to General Settings/Port and change 80 to 8080 or another of your choice. This to allow Apache to use port 80.

In a terminal log in as root. Install Apache2:
apt-get install apache2

Edit /etc/apache2/apache2.conf and change KeepAlive On to Off (use nano to edit files)

Next run these commands:
a2dismod mpm_event
a2enmod mpm_prefork

Follow the install instructions at: https://wiki.zoneminder.com/Debian_8_64 ... e_Easy_Way
except:
Install PHP, and MySQL server. You will be prompted to set a MySQL password
apt-get install php5 mysql-server php-pear php5-mysql php5-gd libapache2-mod-php5

and do not add the jessie-backports main as they are already in OpenMediaVault



Best of luck!
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: apache2 restart php error

Post by rockedge »

Thanks @bbunge! excellent instructions.
I also tried this out with Apache listening on port 86 and openmediavault on port 80. Works as well but it makes more sense for Apache to use port 80. :D
Locked