Page 1 of 1

Call to undefined function apc_fetch()

Posted: Mon Feb 11, 2019 8:26 pm
by ICXC_Nika
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

Re: Call to undefined function apc_fetch()

Posted: Mon Feb 11, 2019 11:11 pm
by knight-of-ni
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.

Re: Call to undefined function apc_fetch()

Posted: Tue Feb 12, 2019 5:31 am
by ICXC_Nika
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.

Re: Call to undefined function apc_fetch()

Posted: Tue Feb 12, 2019 1:23 pm
by knight-of-ni
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.

Re: Call to undefined function apc_fetch()

Posted: Tue Feb 12, 2019 4:40 pm
by ICXC_Nika
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?

Re: Call to undefined function apc_fetch()

Posted: Tue Feb 12, 2019 6:29 pm
by asker
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.

Re: Call to undefined function apc_fetch()

Posted: Wed Feb 13, 2019 3:28 am
by ICXC_Nika
Thank you Asker! I will take a look at it in the AM.

Todd

Re: Call to undefined function apc_fetch()

Posted: Mon Feb 18, 2019 10:00 pm
by ICXC_Nika
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

Re: Call to undefined function apc_fetch()

Posted: Thu Feb 21, 2019 6:03 pm
by ICXC_Nika
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

Re: Call to undefined function apc_fetch()

Posted: Tue Apr 09, 2019 8:55 pm
by ICXC_Nika
I just updated Ubuntu to 18.10 and Zoneminder to 1.33.6 and everything seems to work in IE 11 again.

Re: Call to undefined function apc_fetch()

Posted: Tue Apr 23, 2019 2:41 am
by SpikeyGG
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

Re: Call to undefined function apc_fetch()

Posted: Wed Jul 31, 2019 9:14 am
by uiguy
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