Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Forum for questions and support relating to the 1.30.x releases only.
Locked
Bloodrule
Posts: 10
Joined: Sun Sep 09, 2018 11:19 pm
Location: Melbourne, AU

Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by Bloodrule »

I upgraded my Debian 8 system and (without my actually asking) zm was upgraded from 1.29 to 1.30.4. The new zm is working normally from a browser but I can't get zmNinja working as the APIs are broken. I've followed all the steps in viewtopic.php?t=26575 but without success.

Nimoy reports at the end of that post that apt-get install php7.0-gd and dpkg-reconfigure zoneminder worked for him but my system reported that php7.0-gd was already installed and the newest version and running the dpkg command returned the command prompt without any evidence of anything having happened.

I've restarted zm, restarted apache2, rebooted many times over.

The apache2 error log is saying

[Mon Sep 10 06:29:50.459443 2018] [:error] [pid 9305] [client 203.168.52.22:38121] PHP Fatal error: Call to undefined function apc_fetch() in /usr/share/php/Cake/Cache/Engine/ApcEngine.php on line 91

Any suggestions on where I'm missing something?
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by bbunge »

Possible you need to install php7.0-gd Edit: sorry, did not see that you tried this!

See the WIKI for Debian9 at: https://wiki.zoneminder.com/Debian_9_64 ... e_Easy_Way

You may need to add the timezone to : /etc/php/7.0/apache2/php.ini
Bloodrule
Posts: 10
Joined: Sun Sep 09, 2018 11:19 pm
Location: Melbourne, AU

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by Bloodrule »

Thanks for responding. I tried adding my timezone to /etc/php/7.0/apache2/php.ini and restarted apache2 but it had no effect on the API error. Will go through the wiki for debian 9 (again) and see if I'm missing something.
Bloodrule
Posts: 10
Joined: Sun Sep 09, 2018 11:19 pm
Location: Melbourne, AU

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by Bloodrule »

Still no joy after (again) repeating every step in https://wiki.zoneminder.com/Debian_9_64 ... e_Easy_Way

My apache error log continues to state "PHP Fatal error: Call to undefined function apc_fetch() in /usr/share/php/Cake/Cache/Engine/ApcEngine.php on line 91"

Is it too much to hope that this error is the only reason the APIs are failing? Do you know how I can fix the fatal error?
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by rockedge »

you are missing the php-apcu and php-apcu-bc modules that are not by default in PHP 7+
find these modules and install them and enable them in PHP, and with the other API fix it will work.

some more info https://serverpilot.io/docs/how-to-inst ... -extension
https://packages.ubuntu.com/xenial/php/php-apcu
Bloodrule
Posts: 10
Joined: Sun Sep 09, 2018 11:19 pm
Location: Melbourne, AU

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by Bloodrule »

Thanks for the suggestion. I don't think I am missing the modules. When I apt-get install php-apcu and php-apcu-bc I get "0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded" with the message that I already have the latest versions of each.

But maybe there's something I need to do to enable them in PHP?
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by bbunge »

Check to see if you have two versions of PHP. If you still have PHP5 uninstall it.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by rockedge »

But maybe there's something I need to do to enable them in PHP?
The error indicates these modules are not enabled but to make sure you must get a phpinfo()
and see if PHP has these modules enabled

or try in a terminal

Code: Select all

ap2enmod apcu
ap2enmod apcu-bc
and restart Apache
Bloodrule
Posts: 10
Joined: Sun Sep 09, 2018 11:19 pm
Location: Melbourne, AU

Re: Upgrade Debian 8/zm 1.29 to Debian 9/zm 1.30.4 broke APIs

Post by Bloodrule »

Thanks for your help. All working now thanks to your suggestions.
Locked