(Solved)API not working with PHP 7.2 and Bionic 18.04
Re: API not working with PHP 7.2
the /api/app folder contains the files needed for the ZM API and the /api/lib is the cakephp system that one can swap out different versions......theoretically
The Crud plugin goes into /api/app/Plugin/Crud
The Crud plugin goes into /api/app/Plugin/Crud
Re: API not working with PHP 7.2
I got the API to work somewhat.......very promising the return gave me
Code: Select all
{
"code": 500,
"name": "Class 'AppController' not found",
"message": "Class 'AppController' not found",
"url": "\/zm\/api\/host\/getVersion.json"
}
Re: API not working with PHP 7.2
Using cakephp 2.10.8 and Crud 3.0.10 ( the first version compatible with PHP 7 +) there are a lot of little shortcuts and temp modifications like lines being added and others commented out....as soon as I hammer out this last hurdle of an error(s) I will have to clean it up and try to duplicate it so I can actually add the fix in a less chaotic way....there are all kinds of odd mixing going on but it almost works again.
Re: API not working with PHP 7.2
except for a nagging minor error I have the API running....somewhat!
Re: API not working with PHP 7.2
finally......now to document what actually happened....
zmNinja running with ZM 1.31.1 in PHP 7.2
zmNinja running with ZM 1.31.1 in PHP 7.2
Re: API not working with PHP 7.2
Great! But I will have to shovel out a foot of snow before computer work!
Re: API not working with PHP 7.2
the snow is just starting to fall here....oh no...shovels ready but it may be snowblower time...2nd day of spring and the 4th storm in 4 weeks.....on the beach metal detecting I want to go...but ya can't go surfin' when it's 20 below
the fix seems to easy to do now that I am looking at what really needed to be modified.....and tested Hiawatha and ZM works well and the API also working nicely.
the fix seems to easy to do now that I am looking at what really needed to be modified.....and tested Hiawatha and ZM works well and the API also working nicely.
Re: API not working with PHP 7.2
I just tested the API in iconner's zoneminder-storageareas 1.31.39 by deleting the /usr/share/zoneminder/www/api folder and replacing it with the one from the working version 1.31.1 master ..... and it works.
now I will document the fix and further test by upgrading the cakephp and Crud components as far up as they will go and still work as expected.
now I will document the fix and further test by upgrading the cakephp and Crud components as far up as they will go and still work as expected.
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: API not working with PHP 7.2
Sometimes I think I'm dyslexic... Until just now, I didn't notice there is a Crud 3.1.0 release, which is not to be confused with the 3.0.10 version we use currently. 3.1.0 is compatible with Cakephp 2.x, and it has fixes in it directly related to php 7.2 compatibility. Can you guys try that?
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/
All of these can be found at https://zoneminder.blogspot.com/
Re: API not working with PHP 7.2
yes I will test it where is 3.1.0 to download?
Here it is -> https://github.com/FriendsOfCake/crud/r ... fter=5.1.1
Here it is -> https://github.com/FriendsOfCake/crud/r ... fter=5.1.1
Re: API not working with PHP 7.2
Okay Crud 3.1.0 works..... here is what I did:
Starting with a stock zoneminder 1.31.+
Download the cakephp-2.10.8.zip and extract the contents
1. using the cakephp 2.10.8 folder overwrite the /lib folder in /usr/share/zoneminder/www/api
2. using Crud 3.1.0.zip swap the contents of the file into /usr/share/zoneminder/www/api/app/Plugin/Crud
(change the permissions of the folders to the web server user)
3. open /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Crud/CrudeBaseObject.php and change around line 15
to
the API should work as expected.
the links are:
Crud 3.1.0 :https://github.com/FriendsOfCake/crud/r ... tag/v3.1.0
cakephp 2.10.8 :https://github.com/cakephp/cakephp/arch ... 0.8.tar.gz
Starting with a stock zoneminder 1.31.+
Download the cakephp-2.10.8.zip and extract the contents
1. using the cakephp 2.10.8 folder overwrite the /lib folder in /usr/share/zoneminder/www/api
2. using Crud 3.1.0.zip swap the contents of the file into /usr/share/zoneminder/www/api/app/Plugin/Crud
(change the permissions of the folders to the web server user)
3. open /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Crud/CrudeBaseObject.php and change around line 15
Code: Select all
abstract class CrudBaseObject extends Object implements CakeEventListener {
Code: Select all
abstract class CrudBaseObject extends CakeObject implements CakeEventListener {
the links are:
Crud 3.1.0 :https://github.com/FriendsOfCake/crud/r ... tag/v3.1.0
cakephp 2.10.8 :https://github.com/cakephp/cakephp/arch ... 0.8.tar.gz
Last edited by rockedge on Thu Mar 22, 2018 11:52 pm, edited 4 times in total.
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
YAHOO!!!
Works on Ubuntu 18.04, MySQL, Zoneminder 1.30.4. Tested with ZMNINJA as well as the api/host/getVersion.json
I used the install procedure from Ubuntu 17.10 on the WIKI with a manual download of amd64 ppa Zesty install.
Have to finish cleaning out snow, about 15 inches today, then will try to package this to do an install from a .deb.
Thanks all!!!
Works on Ubuntu 18.04, MySQL, Zoneminder 1.30.4. Tested with ZMNINJA as well as the api/host/getVersion.json
I used the install procedure from Ubuntu 17.10 on the WIKI with a manual download of amd64 ppa Zesty install.
Have to finish cleaning out snow, about 15 inches today, then will try to package this to do an install from a .deb.
Thanks all!!!
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
Repackaged amd64 .deb for Zesty ZM 1.30.4 with the API fixes. Installed on Ubuntu 18.04 server with Mariadb and MySQL per WIKI instructions here with a couple of exceptions: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
Link to install package: https://drive.google.com/file/d/1pxpUTb ... sp=sharing
Download and copy install package zoneminder-bionic-amd64.deb to your home directory. (could not get wget to work with Google Drive)
When editing the php.ini use 7.2 instead if 7.1
Link to install package: https://drive.google.com/file/d/1pxpUTb ... sp=sharing
Download and copy install package zoneminder-bionic-amd64.deb to your home directory. (could not get wget to work with Google Drive)
When editing the php.ini use 7.2 instead if 7.1
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
Can you guys check something for me....
I had a moment to install 18.04, and I can get the api working by changing just the abstract class to mention CakeObject, rather than Object.
The api appears to still work if I skip adding App::uses('AppController', 'Controller');
Can you confirm this?
I had a moment to install 18.04, and I can get the api working by changing just the abstract class to mention CakeObject, rather than Object.
The api appears to still work if I skip adding App::uses('AppController', 'Controller');
Can you confirm this?
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/
All of these can be found at https://zoneminder.blogspot.com/
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
I tested it out with Bionic 18.04 PHP 7.2.3 ZM 1.31.1 and does seem to work with out the line
good deal. I will test it again with ZM 1.31.39 and 1.30.4 but it should be the same. I think I stuck it in there while debugging....
Code: Select all
App::uses('AppController', 'Controller');