zoneminder api 1.30.3 broken on freebsd (solved)

Forum for questions and support relating to the 1.30.x releases only.
Post Reply
fourteen20
Posts: 4
Joined: Sat May 06, 2017 9:35 am

zoneminder api 1.30.3 broken on freebsd (solved)

Post by fourteen20 » Sat May 06, 2017 9:46 am

Code: Select all

2017/05/06 10:25:25 [error] 16296#102163: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined function apc_fetch() in /usr/local/www/zoneminder/api/lib/Cake/Cache/Engine/ApcEngine.php on line 78" while reading response header from upstream, client: 192.168.1.1, server: www.xxx.xxx, request: "GET /api/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm.sock:
running on a freebsd 10.3 jail in freenas, was working perfectly till update (i use the ports version)
as far as i can tell the apc package has been depreciated as not working on php 55 56 70

Code: Select all

# Created by: Thierry Thomas <thierry@pompo.net>
# $FreeBSD: head/www/pecl-APC/Makefile 409110 2016-02-18 14:47:05Z miwi $

PORTNAME=       APC
PORTVERSION=    3.1.14
PORTREVISION=   1
CATEGORIES=     www
#MASTER_SITES=  http://pecl.php.net/get/
MASTER_SITES=   LOCAL/sunpoet
PKGNAMEPREFIX=  pecl-
DISTNAME=       ${PORTNAME}-3.1.13
DIST_SUBDIR=    PECL

MAINTAINER=     sunpoet@FreeBSD.org
COMMENT=        Alternative PHP Cache

LICENSE=        PHP301

DEPRECATED=     Unmaintained by upstream and not work for PHP 5.5+
EXPIRATION_DATE=2016-03-15

OPTIONS_DEFINE= DOCS FILEHITS IPC SEMAPHORES SPINLOCKS
FILEHITS_DESC=  Per request cache info
IPC_DESC=       IPC shm memory support (default: mmap)
SEMAPHORES_DESC=System V IPC semaphores (default: fcntl)
SPINLOCKS_DESC= Spinlocks (experimental)

CFLAGS+=        -I${LOCALBASE}/include
CONFIGURE_ARGS= --enable-apc
IGNORE_WITH_PHP=55 56 70
PHP_MODNAME=    ${PORTNAME:tl}
PKGMESSAGE=     ${WRKDIR}/pkg-message
SUB_FILES=      pkg-message
USE_PHP=        yes
USE_PHPEXT=     yes
USES=           tar:tgz

PORTDOCS=       CHANGELOG INSTALL NOTICE apc.php

FILEHITS_CONFIGURE_ARGS=--enable-apc-filehits
IPC_CONFIGURE_ARGS=     --disable-apc-mmap
SEMAPHORES_CONFIGURE_ARGS=      --enable-apc-sem
SPINLOCKS_CONFIGURE_ARGS=       --enable-apc-spinlocks
 MAKE_JOBS_UNSAFE=yes
post-install-DOCS-on:
        ${MKDIR} ${STAGEDIR}${DOCSDIR}/
        cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/

.include <bsd.port.mk>
I think this is the correct package there is a couple of options but none are installable
Any help would be appreciated
Last edited by fourteen20 on Sat May 06, 2017 10:48 pm, edited 1 time in total.

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

Re: zoneminder api 1.30.3 broken on freebsd

Post by knight-of-ni » Sat May 06, 2017 12:30 pm

Call to undefined function apc_fetch() means the apc module is not loaded. The file to load in your php.ini is going to be either apc.so or apcu.so.

Since you've found a module called apc and it is labelled as unmaintained, I would look instead for a module called apcu, and if you see anything about backwards compatibility you want that too.

Here is the name of the package and its content on my machine running CentOS 7:

Code: Select all

$ rpm -qa |grep apc
php-pecl-apcu-4.0.11-1.el7.x86_64
$ rpm -ql php-pecl-apcu
/etc/php.d/apcu.ini
/usr/lib64/php/modules/apcu.so
/usr/share/doc/pear/apcu
/usr/share/doc/pear/apcu/INSTALL
/usr/share/doc/pear/apcu/LICENSE
/usr/share/doc/pear/apcu/NOTICE
/usr/share/doc/pear/apcu/README.md
/usr/share/doc/pear/apcu/TECHNOTES.txt
/usr/share/doc/pear/apcu/TODO
/var/lib/pear/pkgxml/php-pecl-apcu.xml
You are looking for a package with similar file content.
It seems different distros are doing different things with this module. On Fedora, they split the backwards compatibility portion of the module (which is what you need) into its own package. So on Fedora I need two packages:

Code: Select all

$ rpm -qa |grep apc
php-pecl-apcu-bc-1.0.3-3.fc25.x86_64
php-pecl-apcu-5.1.8-1.fc25.x86_64
Lastly, once you get the module installed, you have to reboot your webserver to get it take effect.

Good luck.
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/

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

Re: zoneminder api 1.30.3 broken on freebsd

Post by knight-of-ni » Sat May 06, 2017 12:37 pm

Googling reveals the following hits:
https://www.freshports.org/devel/pecl-APCu4/
https://www.freshports.org/devel/pecl-APCu/
https://www.freshports.org/devel/php70-APCu/

so there does indeed seem to be multiple versions/types of this module floating around
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/

fourteen20
Posts: 4
Joined: Sat May 06, 2017 9:35 am

Re: zoneminder api 1.30.3 broken on freebsd

Post by fourteen20 » Sat May 06, 2017 3:59 pm

Thanks for reply,
https://www.freshports.org/devel/php70-APCu/ is depreciated to https://www.freshports.org/devel/pecl-APCu/, but the damn package doesn't build, have submitted a bug report to original package maintainer, ill try freebsd port maintainer if that doesnt work.
the https://www.freshports.org/devel/pecl-APCu4/ doesnt seem to do anything on install even after restarting all services. :(
ill keep things posted if it gets fixed

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

Re: zoneminder api 1.30.3 broken on freebsd

Post by knight-of-ni » Sat May 06, 2017 7:23 pm

Is pecl available on FreeBSD?
Seems you can use pecl to install this module onto your system, much in the same way as perl cpan or python pip:
http://stackoverflow.com/questions/2503 ... c-via-pecl

Doing it this way isn't portable, so ultimately we still need a better solution, but at least you aren't dead in the water.
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/

fourteen20
Posts: 4
Joined: Sat May 06, 2017 9:35 am

Re: zoneminder api 1.30.3 broken on freebsd

Post by fourteen20 » Sat May 06, 2017 10:48 pm

tried on a whim installing the binary version of pecl-APCu4 and it worked!
thanks for your help

abi
Posts: 59
Joined: Fri Oct 23, 2015 11:25 am

Re: zoneminder api 1.30.3 broken on freebsd (solved)

Post by abi » Sun May 28, 2017 8:53 pm

Aha, dep is missing in the ZM port.

n8klayko
Posts: 32
Joined: Tue Apr 17, 2018 7:54 pm

Re: zoneminder api 1.30.3 broken on freebsd (solved)

Post by n8klayko » Tue Apr 17, 2018 7:56 pm

abi wrote:
Sun May 28, 2017 8:53 pm
Aha, dep is missing in the ZM port.
Did you manage to get the APIs working on the FreeBSD port version? everything else appears to work correctly except for that and I am having a heck of a time trying to figure out what the issue is and how to fix it.


Respectfully,

fourteen20
Posts: 4
Joined: Sat May 06, 2017 9:35 am

Re: zoneminder api 1.30.3 broken on freebsd (solved)

Post by fourteen20 » Fri Apr 20, 2018 5:56 pm

i did get it all to work as the above, have you seen this thread? https://forums.freenas.org/index.php?th ... 603/page-2
its been a while since i installed.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests