Call to undefined function apc_fetch()

Forum for questions and support relating to 1.33.x development only.
Post Reply
ICXC_Nika
Posts: 11
Joined: Tue May 02, 2017 6:58 pm

Call to undefined function apc_fetch()

Post by ICXC_Nika » Mon Feb 11, 2019 8:26 pm

For the past year I have had Ubuntu 16.04 running ZM 1.30.2. Finally getting tired of the ZM Update popups I updated to Ubuntu 18.04.1 LTS and ZM 1.33.1. It ran fine over the weekend and I can view events from the 10 monitors setup but there are several features in the Web UI that are not working for me. This led me to test PHP and I get:

Code: Select all

Fatal error: Uncaught Error: Call to undefined function apc_fetch() in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/ApcEngine.php:91 Stack trace: #0 /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php(363): ApcEngine->read('myapp_cake_core...') #1 /usr/share/zoneminder/www/api/lib/Cake/I18n/I18n.php(235): Cache::read('cake_dev_en-us', '_cake_core_') #2 /usr/share/zoneminder/www/api/lib/Cake/basics.php(636): I18n::translate('Cache engine "%...', NULL, 'cake_dev') #3 /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php(184): __d('cake_dev', 'Cache engine "%...', '_cake_core_') #4 /usr/share/zoneminder/www/api/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #5 /usr/share/zoneminder/www/api/app/Config/core.php(375): Cache::config('_cake_core_', Array) #6 /usr/share/zoneminder/www/api/lib/Cake/Core/Configure.php(72): include('/usr/share/zone...') #7 /usr/share/zoneminder/www/api/lib/Cake/bootstrap.php(442): Configure::bootstrap(true) #8 /usr/share/zoneminder/www/api/app/webroot/index.php(90): incl in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/ApcEngine.php on line 91
I have gone through several suggestions within posts here but with my non-existent *nix knowledge, I thought I could use some hand holding on this before I make it worse.

Thank you,
Todd
Thank you,
Todd

ZM 1.33.6
Ubuntu 18.10
iconner package

User avatar
knight-of-ni
Posts: 2226
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Call to undefined function apc_fetch()

Post by knight-of-ni » Mon Feb 11, 2019 11:11 pm

You are either missing the apcu package and/or the apcu_bc package (package names can vary), or apcu cache is not enabled in your php.ini.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

ICXC_Nika
Posts: 11
Joined: Tue May 02, 2017 6:58 pm

Re: Call to undefined function apc_fetch()

Post by ICXC_Nika » Tue Feb 12, 2019 5:31 am

Thank you worthy Knight of Ni! I have both packages so I will look at the ini. If it works I shall bring you a shrubbery.
Thank you,
Todd

ZM 1.33.6
Ubuntu 18.10
iconner package

User avatar
knight-of-ni
Posts: 2226
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Call to undefined function apc_fetch()

Post by knight-of-ni » Tue Feb 12, 2019 1:23 pm

Since you are running Ubuntu, you need to be careful to edit the correct php.ini file. I don't recall which one off the top of head, but it should be in the documentation.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

ICXC_Nika
Posts: 11
Joined: Tue May 02, 2017 6:58 pm

Re: Call to undefined function apc_fetch()

Post by ICXC_Nika » Tue Feb 12, 2019 4:40 pm

Thank you! I can only find two php.ini files each for 7.0 and 7.2, none of which make mention of APCU.

I should also mention that the features that do not work in IE, like Add monitor button and rename event, do work in Chrome but Chrome does not show the image.

Code: Select all

find / -type f -name "php.ini"

Code: Select all

/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cli/php.ini
/etc/php/7.2/apache2/php.ini
/etc/php/7.2/cli/php.ini
php-apcu is already the newest version (5.1.9+4.0.11-1build1)
php-apcu-bc is already the newest version (1.0.3-2xenial2)

Is it of consequence that my php-apcu-bc denotes Xenial and my OS is now Bionic?

Which Docs will I be able to find the apcu Cache described?
Thank you,
Todd

ZM 1.33.6
Ubuntu 18.10
iconner package

User avatar
asker
Posts: 1070
Joined: Sun Mar 01, 2015 12:12 pm

Re: Call to undefined function apc_fetch()

Post by asker » Tue Feb 12, 2019 6:29 pm

Incidentally, I spent a few hours struggling with apc_fetch() foo when I updated to Ubuntu 18. I installed everything many times and only later realized my CLI PHP was 7.2 but Apache was using 7.0. So I had to do a a2dismod php7.0 and a2enmod php7.2 and voila.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

ICXC_Nika
Posts: 11
Joined: Tue May 02, 2017 6:58 pm

Re: Call to undefined function apc_fetch()

Post by ICXC_Nika » Wed Feb 13, 2019 3:28 am

Thank you Asker! I will take a look at it in the AM.

Todd
Thank you,
Todd

ZM 1.33.6
Ubuntu 18.10
iconner package

ICXC_Nika
Posts: 11
Joined: Tue May 02, 2017 6:58 pm

Re: Call to undefined function apc_fetch()

Post by ICXC_Nika » Mon Feb 18, 2019 10:00 pm

Thank you @ASKER - My getVersion.json now returns:

Code: Select all

{
    "version": "1.33.1",
    "apiversion": "1.0"
}
But my ADD and Rename (among other) buttons still are not working. They don't do anything in IE.

Todd
Thank you,
Todd

ZM 1.33.6
Ubuntu 18.10
iconner package

ICXC_Nika
Posts: 11
Joined: Tue May 02, 2017 6:58 pm

Re: Call to undefined function apc_fetch()

Post by ICXC_Nika » Thu Feb 21, 2019 6:03 pm

I am still troubleshooting why the 'Add' monitor button doesn't work in IE, it does work in Chrome.

the following error is in the /var/log/apache2.log file:

Code: Select all

PHP7:NOTICE object does not support property or object 'foreach' 
Could these be related?

Todd
Thank you,
Todd

ZM 1.33.6
Ubuntu 18.10
iconner package

ICXC_Nika
Posts: 11
Joined: Tue May 02, 2017 6:58 pm

Re: Call to undefined function apc_fetch()

Post by ICXC_Nika » Tue Apr 09, 2019 8:55 pm

I just updated Ubuntu to 18.10 and Zoneminder to 1.33.6 and everything seems to work in IE 11 again.
Thank you,
Todd

ZM 1.33.6
Ubuntu 18.10
iconner package

SpikeyGG
Posts: 47
Joined: Mon Oct 15, 2012 12:02 am

Re: Call to undefined function apc_fetch()

Post by SpikeyGG » Tue Apr 23, 2019 2:41 am

asker wrote:
Tue Feb 12, 2019 6:29 pm
Incidentally, I spent a few hours struggling with apc_fetch() foo when I updated to Ubuntu 18. I installed everything many times and only later realized my CLI PHP was 7.2 but Apache was using 7.0. So I had to do a a2dismod php7.0 and a2enmod php7.2 and voila.
I was having a similar issue with 1.33.6 on my machine. So I tried a2dismod php7.0 and a2enmod php7.2, and it fixes the api call (I see the version detail when hitting the getVersion.json) but it completely breaks my web interface (goes all white, no warnings no errors).

I can reenable 7.0 and disable 7.2 and the web interface comes back but the api breaks. lol

uiguy
Posts: 6
Joined: Wed Mar 08, 2017 3:29 pm

Re: Call to undefined function apc_fetch()

Post by uiguy » Wed Jul 31, 2019 9:14 am

Hi,

On upgrading to ubuntu 19.04 I am experiencing this problem. I followed the steps outlined above, but came across this:

Code: Select all

root@ZM1:/home/uiguy# find / -type f -name "php.ini"
/etc/php/7.0/apache2/php.ini
/etc/php/7.2/cli/php.ini
/etc/php/7.2/apache2/php.ini
root@ZM1:/home/uiguy# /etc/php/7.2/cli/php.ini
bash: /etc/php/7.2/cli/php.ini: Permission denied
root@ZM1:/home/uiguy# /etc/php/7.2/apache2/php.ini
bash: /etc/php/7.2/apache2/php.ini: Permission denied
root@ZM1:/home/uiguy# a2dismod php7.0
Module php7.0 already disabled
root@ZM1:/home/uiguy# a2enmod php7.2
Considering dependency mpm_prefork for php7.2:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.2:
Module php7.2 already enabled
root@ZM1:/home/uiguy#
Can anyone help?

Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests