(Solved)API not working with PHP 7.2 and Bionic 18.04
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
I ran it again and using Bionic 18.04 PHP 7.2.3 ZM 1.30.4 swapped in the cakephp 2.10.8 /lib folder and replaced Crud with version 3.1.0 then changed line 15 and the name of the abstract class and the API works.
- 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
Not a problem. I'm just trying to understand this as best I can... the best way to fix this is file a bug report with the Crud project, but that's always tough when you don't know enough about how things work to describe the problem well enough and then intelligently answer questions.
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
Went back to the original api and made the change to CakeObject. the api did not work with the original cakephp and crud.knnniggett wrote: ↑Thu Mar 22, 2018 9:17 pm 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?
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
if you use the stock API and that version of cakephp, 2.8 I think, there is no change in /usr/share/zoneminder/www/api/lib/Cake/Core. The version 2.10.8 includes the file /usr/share/zoneminder/www/api/lib/Cake/Core/CakeObject.php. This is really Object.php renamed and Object.php is rewritten to only refer to CakeObject.php. When we rename the Class Object to CakeObject in /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Crud/CrudBaseObject.php the code is now pointing to the CakeObject.php.
One can use the stock cakephp I think by renaming /usr/share/zoneminder/www/api/lib/Cake/Core/Object.php. to CakeObject.php then change the lines in Object.php to do the same function as the new version in cakephp 2.10.8 and do the change to /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Crud/CrudBaseObject.php...I think it may work but is more involved then overwriting the /lib/Cake folder with v2.10.8 and throw in the newer version 3.1.0 of Crud and modify one line....
One can use the stock cakephp I think by renaming /usr/share/zoneminder/www/api/lib/Cake/Core/Object.php. to CakeObject.php then change the lines in Object.php to do the same function as the new version in cakephp 2.10.8 and do the change to /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Crud/CrudBaseObject.php...I think it may work but is more involved then overwriting the /lib/Cake folder with v2.10.8 and throw in the newer version 3.1.0 of Crud and modify one line....
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
the problem appears to be that in /usr/share/zoneminder/www/api/lib/Cake/Core/Object.php in version cakephp 2.10.8
this is the new code
and one would think that the Crud reference to "Object" would then be referred to CakeObject.php... but as we can tell....that is not true because we need to make the change to the line of code in Crud.
It would seem the coder's from Crud should make the change and release a version of Crud 3.1.1 as a favor maybe
this is the new code
Code: Select all
App::uses('CakeObject', 'Core');
class_alias('CakeObject', 'Object');
It would seem the coder's from Crud should make the change and release a version of Crud 3.1.1 as a favor maybe
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
I think we are going to have to send a PR to the Crud guys. Others could benefit from this work too.
- 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
PR created:
https://github.com/FriendsOfCake/crud/issues/581
https://github.com/FriendsOfCake/crud/issues/581
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
Wow, Thank you! Now api works with php7.2!knight-of-ni wrote: ↑Fri Mar 23, 2018 9:44 pm PR created:
https://github.com/FriendsOfCake/crud/issues/581
Re: (Solved)API not working with PHP 7.2 and Bionic 18.04
Hi, I have also the problem that I´ve got an error message from CakePHP 2.10.8.:
Your tmp directory is NOT writable.
I´m running Zoneminder 1.32.3 on Ubuntu 18.04. Zoneminder is working well in the browser window, but I don´t have any acces from zmNinja. All symbolic links from /user/share/zoneminder... and deeper are pointing to /tmp and set to www-data:www-data 777.
Any idea what´s going wrong?
Your tmp directory is NOT writable.
I´m running Zoneminder 1.32.3 on Ubuntu 18.04. Zoneminder is working well in the browser window, but I don´t have any acces from zmNinja. All symbolic links from /user/share/zoneminder... and deeper are pointing to /tmp and set to www-data:www-data 777.
Any idea what´s going wrong?