Page 1 of 1

Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Sat Feb 27, 2016 6:47 pm
by maco1717
Hi,

Let me share my experience getting Zoneminder 1.29 to work on Raspberry Pi 2 Debian 8 (Jessy) API enable to work with zmNinja.

follow this wiki.

It will ask you to setup time zone, do the following:

Add timezone to php

Code: Select all

sudo nano /etc/php5/apache2/php.ini
Search for [Date]

Code: Select all

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/London
You might need to restart apache

Code: Select all

sudo service apache2 restart
At this stage Zoneminder should work but when testing the API it will return an error saying something like
URL rewriting is not properly configured on your server...
from*

edit apache zoneminder.conf

Code: Select all

sudo nano etc/apache2/conf-enabled/zoneminder.conf
and add the bellow code to the end of the file

Code: Select all

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
Enable rewrite configuration in Apache.

Code: Select all

a2enmod rewrite
At this stage if you restart apache service API should show green

Code: Select all

sudo service apache2 restart
Adding the following steps to get video footage to show on the device
Install php5-gd

Code: Select all

sudo apt-get install php5-gd
Change permission off API

Code: Select all

sudo chown -R www-data:www-data /usr/share/zoneminder/www/api
Restart apache service and zoneminder

Code: Select all

sudo service apache2 restart
sudo service zoneminder restart

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Sat Feb 27, 2016 9:08 pm
by asker
Thanks for posting!

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Wed Oct 12, 2016 8:12 pm
by trekimann
I know this is an old thread but I just had this problem. Followed the instructions but I get
Warning: mkdir(): Permission denied in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/FileEngine.php on line 379

Warning: _cake_core_ cache was unable to write 'cake_dev_en' to File cache in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 323

Warning: /usr/share/zoneminder/www/api/app/tmp/cache/persistent/ is not writable in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/FileEngine.php on line 384

Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /usr/share/zoneminder/www/api/app/Config/core.php(376): Cache::config('_cake_core_', Array) #2 /usr/share/zoneminder/www/api/lib/Cake/Core/Configure.php(72): include('/usr/share/zone...') #3 /usr/share/zoneminder/www/api/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /usr/share/zoneminder/www/api/app/webroot/index.php(90): include('/usr/share/zone...') #5 {main} thrown in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 181

When I try to open http://serverip/zm/api
I expect I am just missing something simple but I don't know where to go from here.

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Wed Oct 12, 2016 10:42 pm
by maco1717
Hi Trekimann,

I Wouldn't know why you having this problem, for the looks of it it looks like some permission issues, I recall having issues with cake myself. have you checked that that folder has the right permission I would advise giving all user and group read and write permission.

I could try and have a look see if following my post give's me some issues, but I wont be able to do it till next week, earliest. On the mean time maybe someone else can advise. you could also try and doing everything from scratch from a clean Raspbian install.

Also make sure you are using the same version as I as newer version might be installed differently or may not work.

Try to google the error you are getting an read about it. See if that throws some light. Also You can ignore the warnings, just focus on the "Fatal error"
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /usr/share/zoneminder/www/api/app/Config/core.php(376): Cache::config('_cake_core_', Array) #2 /usr/share/zoneminder/www/api/lib/Cake/Core/Configure.php(72): include('/usr/share/zone...') #3 /usr/share/zoneminder/www/api/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /usr/share/zoneminder/www/api/app/webroot/index.php(90): include('/usr/share/zone...') #5 {main} thrown in /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 181
Lets us know how you do.

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Wed Oct 12, 2016 11:06 pm
by trekimann
I am using 1.29 as that is the newest which will run on the PI (as far as I know) Which folder would I maybe need to change the permissions for? /usr/share/zoneminder/www/api ?

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Wed Oct 12, 2016 11:22 pm
by maco1717
have a look at this:

CacheException' with message 'Cache engine _cake_core_ is not properly configured /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php on line 181 - Google Search:
https://www.google.co.uk/search?q=Cache ... n+line+181

Clean Install API Permission Issues - ZoneMinder Forums:
viewtopic.php?t=23947

php - Cakephp cake_core_ cache was unable to write 'cake_dev_en-us' - Stack Overflow:
http://stackoverflow.com/questions/1822 ... -dev-en-us

php - CakePHP unable to write to certain files - Stack Overflow:
http://stackoverflow.com/questions/9379 ... tain-files

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Wed Dec 07, 2016 3:28 pm
by trekimann
if anyone is interested it turned out that I needed to also use the command
sudo chown -R www-data:www-data /usr/share/zoneminder/www/api
and restart zoneminder and apache. seems to be all sorted now

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Wed Dec 07, 2016 4:52 pm
by maco1717
Hi trekimann,

Thanks for letting us know.

Regards.

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Thu Dec 15, 2016 1:23 pm
by knight-of-ni
Moved to the mobile apps forum.

Re: Raspbian Zoneminder 1.29 API zmNinja Instructions

Posted: Mon Jun 12, 2017 10:50 pm
by maco1717
Hi trekimann,

Thanks for that.

I can confirm that there where missing steps. I'll update the original post with this step.

Kind regards.
\M