Re: ZM 1.30.4 API issue on ubuntu 17.10
Posted: Mon Feb 05, 2018 1:05 pm
I did a 17.10 Ubuntu with ZM 1.30.4 install from the wiki instructions the other day and everything worked!
ZoneMinder Forums
https://forums.zoneminder.com/
Code: Select all
[Tue Feb 06 20:37:47.104293 2018] [:error] [pid 15773] [client 192.168.0.22:61793] PHP Fatal error: Uncaught Error: Call to undefined function apc_fetch() in /usr/share/php/Cake/Cache/Engine/ApcEngine.php:91\nStack trace:\n#0 /usr/share/php/Cake/Cache/Cache.php(363): ApcEngine->read('myapp_cake_core...')\n#1 /usr/share/php/Cake/I18n/I18n.php(235): Cache::read('cake_dev_en-gb', '_cake_core_')\n#2 /usr/share/php/Cake/basics.php(636): I18n::translate('Cache engine "%...', NULL, 'cake_dev')\n#3 /usr/share/php/Cake/Cache/Cache.php(184): __d('cake_dev', 'Cache engine "%...', '_cake_core_')\n#4 /usr/share/php/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')\n#5 /etc/zm/core.php(375): Cache::config('_cake_core_', Array)\n#6 /usr/share/php/Cake/Core/Configure.php(72): include('/etc/zm/core.ph...')\n#7 /usr/share/php/Cake/bootstrap.php(431): Configure::bootstrap(true)\n#8 /usr/share/zoneminder/www/api/app/webroot/index.php(90): include('/usr/share/php/...')\n#9 {main}\n thrown in /usr/share/php/Cake/Cache/Engine/ApcEngine.php on line 91
Hi!Pyrotechnic wrote: ↑Tue Feb 06, 2018 8:39 pm After initially getting this issue on 17.04 I managed to get everything working, but I've just upgraded to 17.10, and this issue is back. I can't for the life of me remember how I solved it last time...
Apache log contains:
Code: Select all
[Tue Feb 06 20:37:47.104293 2018] [:error] [pid 15773] [client 192.168.0.22:61793] PHP Fatal error: Uncaught Error: Call to undefined function apc_fetch() in /usr/share/php/Cake/Cache/Engine/ApcEngine.php:91\nStack trace:\n#0 /usr/share/php/Cake/Cache/Cache.php(363): ApcEngine->read('myapp_cake_core...')\n#1 /usr/share/php/Cake/I18n/I18n.php(235): Cache::read('cake_dev_en-gb', '_cake_core_')\n#2 /usr/share/php/Cake/basics.php(636): I18n::translate('Cache engine "%...', NULL, 'cake_dev')\n#3 /usr/share/php/Cake/Cache/Cache.php(184): __d('cake_dev', 'Cache engine "%...', '_cake_core_')\n#4 /usr/share/php/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')\n#5 /etc/zm/core.php(375): Cache::config('_cake_core_', Array)\n#6 /usr/share/php/Cake/Core/Configure.php(72): include('/etc/zm/core.ph...')\n#7 /usr/share/php/Cake/bootstrap.php(431): Configure::bootstrap(true)\n#8 /usr/share/zoneminder/www/api/app/webroot/index.php(90): include('/usr/share/php/...')\n#9 {main}\n thrown in /usr/share/php/Cake/Cache/Engine/ApcEngine.php on line 91
Code: Select all
PHP Fatal error: Uncaught InternalErrorException: Internal Server Error in /usr/share/php/Cake/Error/ErrorHandler.php:276\nStack trace:\n#0 /usr/share/php/Cake/Error/ErrorHandler.php(213): ErrorHandler::handleFatalError(256, '[MissingPluginE...', '/usr/share/php/...', 138)\n#1 [internal function]: ErrorHandler::handleError(256, '[MissingPluginE...', '/usr/share/php/...', 138, Array)\n#2 /usr/share/php/Cake/Error/ErrorHandler.php(138): trigger_error('[MissingPluginE...', 256)\n#3 [internal function]: ErrorHandler::handleException(Object(MissingPluginException))\n#4 {main}\n thrown in /usr/share/php/Cake/Error/ErrorHandler.php on line 276
Code: Select all
PHP Fatal error: Uncaught InternalErrorException: Internal Server Error in /usr/share/php/Cake/Error/ErrorHandler.php:276\nStack trace:\n#0 /usr/share/php/Cake/Error/ErrorHandler.php(213): ErrorHandler::handleFatalError(256, '[MissingPluginE...', '/usr/share/php/...', 138)\n#1 [internal function]: ErrorHandler::handleError(256, '[MissingPluginE...', '/usr/share/php/...', 138, Array)\n#2 /usr/share/php/Cake/Error/ErrorHandler.php(138): trigger_error('[MissingPluginE...', 256)\n#3 [internal function]: ErrorHandler::handleException(Object(MissingPluginException))\n#4 {main}\n thrown in /usr/share/php/Cake/Error/ErrorHandler.php on line 276
Code: Select all
mkdir -p /usr/share/zoneminder/www/api/app/Plugin/Crud/
cd /tmp
wget https://github.com/FriendsOfCake/crud/archive/c3976f1478c681b0bbc132ec3a3e82c3984eeed5.zip
unzip c3976f1478c681b0bbc132ec3a3e82c3984eeed5.zip
cp -r ./crud-c3976f1478c681b0bbc132ec3a3e82c3984eeed5/* /usr/share/zoneminder/www/api/app/Plugin/Crud/
Nope, looks like there's no official apc for php7.0. I've tried installing it via no-idea what methods I found online, but still getting the same error :/mic07 wrote: ↑Tue Feb 06, 2018 9:16 pmHi!Pyrotechnic wrote: ↑Tue Feb 06, 2018 8:39 pm After initially getting this issue on 17.04 I managed to get everything working, but I've just upgraded to 17.10, and this issue is back. I can't for the life of me remember how I solved it last time...
Apache log contains:
Code: Select all
[Tue Feb 06 20:37:47.104293 2018] [:error] [pid 15773] [client 192.168.0.22:61793] PHP Fatal error: Uncaught Error: Call to undefined function apc_fetch() in /usr/share/php/Cake/Cache/Engine/ApcEngine.php:91\nStack trace:\n#0 /usr/share/php/Cake/Cache/Cache.php(363): ApcEngine->read('myapp_cake_core...')\n#1 /usr/share/php/Cake/I18n/I18n.php(235): Cache::read('cake_dev_en-gb', '_cake_core_')\n#2 /usr/share/php/Cake/basics.php(636): I18n::translate('Cache engine "%...', NULL, 'cake_dev')\n#3 /usr/share/php/Cake/Cache/Cache.php(184): __d('cake_dev', 'Cache engine "%...', '_cake_core_')\n#4 /usr/share/php/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')\n#5 /etc/zm/core.php(375): Cache::config('_cake_core_', Array)\n#6 /usr/share/php/Cake/Core/Configure.php(72): include('/etc/zm/core.ph...')\n#7 /usr/share/php/Cake/bootstrap.php(431): Configure::bootstrap(true)\n#8 /usr/share/zoneminder/www/api/app/webroot/index.php(90): include('/usr/share/php/...')\n#9 {main}\n thrown in /usr/share/php/Cake/Cache/Engine/ApcEngine.php on line 91
I had the same issue, because php-apcu and php-apcu-bc were missing. If Ubuntu has packages like php7.0-apcu and php7.0-apcu-bc, you might want to use them instead.
After installation, you need to reload apache.
Now I'm stuck with:BRCode: Select all
PHP Fatal error: Uncaught InternalErrorException: Internal Server Error in /usr/share/php/Cake/Error/ErrorHandler.php:276\nStack trace:\n#0 /usr/share/php/Cake/Error/ErrorHandler.php(213): ErrorHandler::handleFatalError(256, '[MissingPluginE...', '/usr/share/php/...', 138)\n#1 [internal function]: ErrorHandler::handleError(256, '[MissingPluginE...', '/usr/share/php/...', 138, Array)\n#2 /usr/share/php/Cake/Error/ErrorHandler.php(138): trigger_error('[MissingPluginE...', 256)\n#3 [internal function]: ErrorHandler::handleException(Object(MissingPluginException))\n#4 {main}\n thrown in /usr/share/php/Cake/Error/ErrorHandler.php on line 276
Can you check if apcu is mentioned in phpinfo(). In order to test for your web server, create a new .php file ("version.php") in the root directory of your web server with the following content:Pyrotechnic wrote: ↑Fri Feb 09, 2018 11:17 pm Nope, looks like there's no official apc for php7.0. I've tried installing it via no-idea what methods I found online, but still getting the same error :/
Code: Select all
<?php
phpinfo();
?>
Code: Select all
apt list --installed | grep php
Code: Select all
/etc/php/7.0/apache2/conf.d/20-apcu.ini
/etc/php/7.0/mods-available/apcu.ini
I get:
Code: Select all
cakephp/artful,artful,now 2.8.5-1 all [installed,automatic]
cakephp-scripts/artful,artful,now 2.8.5-1 all [installed,automatic]
libapache2-mod-php/artful,artful,now 1:7.1+54ubuntu1 all [installed]
libapache2-mod-php7.0/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
libapache2-mod-php7.1/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
libphp-serialization-perl/artful,artful,now 0.34-1 all [installed,automatic]
php/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php-apcu/artful,now 5.1.8+4.0.11-1build1 amd64 [installed]
php-apcu-bc/artful,now 1.0.3-2ubuntu1 amd64 [installed,automatic]
php-bz2/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php-common/artful,artful,now 1:54ubuntu1 all [installed]
php-curl/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php-gd/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php-mbstring/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php-mcrypt/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php-mysql/artful,artful,now 1:7.1+54ubuntu1 all [installed]
php-pear/artful,artful,now 1:1.10.5+submodules+notgz-1 all [installed]
php-php-gettext/artful,artful,now 1.0.12-0.1 all [installed,automatic]
php-phpseclib/artful,artful,now 2.0.6-1 all [installed,automatic]
php-tcpdf/artful,artful,now 6.2.12+dfsg2-1ubuntu1 all [installed,automatic]
php-xml/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php-zip/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic]
php7.0/now 7.0.22-0ubuntu0.17.04.1 all [installed,local]
php7.0-bz2/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-cli/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-common/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-curl/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-gd/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-json/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-mbstring/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-mcrypt/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-mysql/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-opcache/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-readline/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-xml/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.0-zip/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local]
php7.1/artful-updates,artful-updates,now 7.1.11-0ubuntu0.17.10.1 all [installed,automatic]
php7.1-bz2/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-cli/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-common/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-curl/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-dev/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed]
php7.1-gd/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-json/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-mbstring/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-mcrypt/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-mysql/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-opcache/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-readline/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-xml/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
php7.1-zip/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic]
phpmyadmin/artful,artful,now 4:4.6.6-5 all [installed]
pkg-php-tools/artful,artful,now 1.35 all [installed,automatic]
I have:mic07 wrote: ↑Mon Feb 12, 2018 6:26 pm And please also check if you have files like:Code: Select all
/etc/php/7.0/apache2/conf.d/20-apcu.ini /etc/php/7.0/mods-available/apcu.ini
Did you try a clean installation with only one PHP version in the past?Pyrotechnic wrote: ↑Mon Feb 12, 2018 10:19 pm mentioned in the 'Additional .ini files parsed' section, but not other occurrence of 'apc' on the page.
I have:Code: Select all
cakephp/artful,artful,now 2.8.5-1 all [installed,automatic] cakephp-scripts/artful,artful,now 2.8.5-1 all [installed,automatic] libapache2-mod-php/artful,artful,now 1:7.1+54ubuntu1 all [installed] libapache2-mod-php7.0/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] libapache2-mod-php7.1/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] libphp-serialization-perl/artful,artful,now 0.34-1 all [installed,automatic] php/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php-apcu/artful,now 5.1.8+4.0.11-1build1 amd64 [installed] php-apcu-bc/artful,now 1.0.3-2ubuntu1 amd64 [installed,automatic] php-bz2/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php-common/artful,artful,now 1:54ubuntu1 all [installed] php-curl/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php-gd/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php-mbstring/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php-mcrypt/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php-mysql/artful,artful,now 1:7.1+54ubuntu1 all [installed] php-pear/artful,artful,now 1:1.10.5+submodules+notgz-1 all [installed] php-php-gettext/artful,artful,now 1.0.12-0.1 all [installed,automatic] php-phpseclib/artful,artful,now 2.0.6-1 all [installed,automatic] php-tcpdf/artful,artful,now 6.2.12+dfsg2-1ubuntu1 all [installed,automatic] php-xml/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php-zip/artful,artful,now 1:7.1+54ubuntu1 all [installed,automatic] php7.0/now 7.0.22-0ubuntu0.17.04.1 all [installed,local] php7.0-bz2/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-cli/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-common/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-curl/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-gd/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-json/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-mbstring/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-mcrypt/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-mysql/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-opcache/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-readline/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-xml/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.0-zip/now 7.0.22-0ubuntu0.17.04.1 amd64 [installed,local] php7.1/artful-updates,artful-updates,now 7.1.11-0ubuntu0.17.10.1 all [installed,automatic] php7.1-bz2/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-cli/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-common/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-curl/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-dev/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed] php7.1-gd/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-json/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-mbstring/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-mcrypt/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-mysql/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-opcache/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-readline/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-xml/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] php7.1-zip/artful-updates,now 7.1.11-0ubuntu0.17.10.1 amd64 [installed,automatic] phpmyadmin/artful,artful,now 4:4.6.6-5 all [installed] pkg-php-tools/artful,artful,now 1.35 all [installed,automatic]
/etc/php/7.0/apache2/conf.d/20-apcu.ini
/etc/php/7.0/apache2/conf.d/20-apcu_bc.ini
/etc/php/7.0/apache2/conf.d/30-apcu.ini
/etc/php/7.0/mods-available/apcu.ini
/etc/php/7.0/mods-available/apcu_bc.ini
Code: Select all
cat /etc/php/<PHP Version>/apache2/conf.d/20-apcu.ini
Code: Select all
find / -name apcu.so
Code: Select all
chown -R www-data /usr/share/zoneminder
Code: Select all
{"version":"1.30.4","apiversion":"1.0"}
Your best bet is to start over with Ubuntu 16.04. See the install instructions at:naamah75 wrote: ↑Thu Feb 22, 2018 1:44 pm After reading entiere thread I've discovered that my problem can be the lack of the folder /usr/share/zoneminder/www/api/app/Plugin.
... but I've a very noob and I've not understand what I must do with Crud (what is Crud?) and where to find the content to copy in the folder.
Please somenone can post some simple step for me?
Code: Select all
http://localhost/zm/api/host/getVersion.json
Well, looks like you are in a bind. I say this because you will likely want to upgrade to 18.04 when it is released at the end of April. If you spend a lot of time getting Zoneminder to work on 17.10 it is highly likely the upgrade to 18.04 will mess it up again. Just wanted you to know.