API not working on ZM_1.30.4 / OpenSuse Leap 15.0

Forum for questions and support relating to the 1.30.x releases only.
Locked
ghieber
Posts: 2
Joined: Tue Feb 04, 2014 10:38 pm

API not working on ZM_1.30.4 / OpenSuse Leap 15.0

Post by ghieber »

I installed Zoneminder on an older machine with a freshly installed OpenSuse Leap 15.0. I followed the instructions given on https://wiki.zoneminder.com/Installing_ ... s_for_SuSE. The key components' versions are:

ZoneMinder-MP 1.30.4-2.1
Apache2 2.4.33-lp150.1.2
apache2_mod_php7 7.2.5-lp150.1.7
php7 7.2.5-lp150.1.7
php7-APCu 5.1.11-lp150.1.1
Mariadb 10.2.15-lp150.2.3.2

ZoneMinder options are set: OPT_USE_AUTH off, OPT_USE_API on. Everything at it's default setting.

The web directory tree looks like this:

/srv/www/htdocs/zm/ --
-- api/ -- app
-- lib
--

Zoneminder and the web interface work. I can install and view cameras, both local, remote and ffmpeg.

The API's don't work. Any API - related URL (http://myserver/zm/api/host/getVersion.json, http://myserver/zm/api/monitors.json, ....) returns an Error 404, object not found.

The apache logs give no clue. access.log shows the access from the client machine, error..log has no entry.

The picture changes when I call the URL http://myserver/zm/api/. This results in an error 500, and a lengthy entry in error.log:

Code: Select all

[Sat Jul 21 01:20:49.686150 2018] [php7:error] [pid 1689] [client 192.168.1.81:54420] 
 PHP Fatal error:  Uncaught Error: Call to undefined function apc_fetch() in /srv/www/htdocs/zm/api/lib/Cake/Cache/Engine/ApcEngine.php:78\nStack trace:\n#0 
 /srv/www/htdocs/zm/api/lib/Cake/Cache/Cache.php(363): ApcEngine->read('myapp_cake_core...')\n#1 
 /srv/www/htdocs/zm/api/lib/Cake/I18n/I18n.php(235): Cache::read('cake_dev_de-de', '_cake_core_')\n#2 
 /srv/www/htdocs/zm/api/lib/Cake/basics.php(636): I18n::translate('Cache engine "%...', NULL, 'cake_dev')\n#3 
 /srv/www/htdocs/zm/api/lib/Cake/Cache/Cache.php(184): __d('cake_dev', 'Cache engine "%...', '_cake_core_')\n#4 
 /srv/www/htdocs/zm/api/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')\n#5
  /srv/www/htdocs/zm/api/app/Config/core.php(375): Cache::config('_cake_core_', Array)\n#6
   /srv/www/htdocs/zm/api/lib/Cake/Core/Configure.php(72): include('/srv/www/htdocs...')\n#7 /srv/www/htdocs/zm/api/lib/Cake/bootstrap.php(434)
   : Configure::bootstrap(true)\n#8 /srv/www/htdocs/zm/api/app/webroot/index.php(94): include('/srv/www/htdocs...')\n#9 
   /srv/www/htdocs/zm/api/index.php(41): req in /srv/www/htdocs/zm/api/lib/Cake/Cache/Engine/ApcEngine.php on line 78

I am cautious with conclutions, as I have basically no idea how the whole apache / php / cake machinery works. My impression from the observations so far is, that it's running (otherwise cake could not try to call any function, defined or not), but for some reason is unable to handle the url that goes beyond ../api. I would suppose something wrong in one of the config files, but what?

Any hint where to look is more than appreciated.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: API not working on ZM_1.30.4 / OpenSuse Leap 15.0

Post by rockedge »

yes this sounds like the fix we already have. The problem which began with PHP 7.2.+ is easy to rectify. it involves downloading 2 small packages and replacing 2 components of ZM and one change line in the code. Here is my post about it.... viewtopic.php?p=105092#p105092

viewtopic.php?f=36&t=27400
Locked