Page 1 of 1

zoneminder api 1.30.3 broken on freebsd (solved)

Posted: Sat May 06, 2017 9:46 am
by fourteen20

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

Re: zoneminder api 1.30.3 broken on freebsd

Posted: Sat May 06, 2017 12:30 pm
by knight-of-ni
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.

Re: zoneminder api 1.30.3 broken on freebsd

Posted: Sat May 06, 2017 12:37 pm
by knight-of-ni
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

Re: zoneminder api 1.30.3 broken on freebsd

Posted: Sat May 06, 2017 3:59 pm
by fourteen20
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

Re: zoneminder api 1.30.3 broken on freebsd

Posted: Sat May 06, 2017 7:23 pm
by knight-of-ni
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.

Re: zoneminder api 1.30.3 broken on freebsd

Posted: Sat May 06, 2017 10:48 pm
by fourteen20
tried on a whim installing the binary version of pecl-APCu4 and it worked!
thanks for your help

Re: zoneminder api 1.30.3 broken on freebsd (solved)

Posted: Sun May 28, 2017 8:53 pm
by abi
Aha, dep is missing in the ZM port.

Re: zoneminder api 1.30.3 broken on freebsd (solved)

Posted: Tue Apr 17, 2018 7:56 pm
by n8klayko
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,

Re: zoneminder api 1.30.3 broken on freebsd (solved)

Posted: Fri Apr 20, 2018 5:56 pm
by fourteen20
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.