Page 1 of 1

API - troubleshooting help request

Posted: Mon Jun 27, 2016 3:03 pm
by kkrofft
Running CentOs 6.6 with a recent upgrade to ZM 1.29. I use DNSexit for DDNS so I can check events from remote computers but can't seem to get
web access via my Android phone. Browsers on the phone error out with "This site can't be reached" "ERR_CONNECTION REFUSED". I believe this is due to the self generated certificate being rejected due to my employer's security requirements.

So I would like to get ZMNinja working. I can get the Windows app to reach the installation but I get "Login validated but API failed. After searching around, I see that CentOs requires an update to PHP which I did. I also found a posting with the identical error message and it refers to:
https://github.com/pliablepixels/zmNinj ... -apis-work
Accessing this url I found a referral to "Bill Bunge's ubuntu page for Zoneminder " Had to hunt around a bit but did find a link in the FAQ section that referred me back to the pliablepixels/ZMNinja wiki where I did find info on upgrading PHP which I followed.

So here I am, if I try to connect to the API (https://<server>/zm/api) I get this error. "Error: syntax error, unexpected T_USE, expecting T_FUNCTION
File: /usr/share/zoneminder/www/api/app/Controller/AppController.php
Line: 34"

Where do I go from here?

Thank you!
KK

Re: API - troubleshooting help request

Posted: Tue Jun 28, 2016 8:02 pm
by asker
I've tried to respond to this question several times, but closed the window each time because there are many potential issues and the post is a bit scant on details. So let's try:

The core issue seems to be PHP version incompatibility -- given that you have started from CentOS 6.6 and moved to an unofficial PHP port, plus there aren't too many details about how you upgraded your ZM, etc. there are too many variables to offer hints (exacerbated by the fact that I have no hands-on knowledge of CentOS and 3rd party PHP installs)

Hopefully someone who has gone down this path may help you further. If you followed https://www.freesoftwareservers.com/ind ... -centos-6/ to upgrade PHP, you may want to as the author of that article - he is usually pretty responsive.

(Resolved) Re: API - troubleshooting help request

Posted: Wed Jun 29, 2016 3:42 pm
by kkrofft
Asker,

Thanks for the reply. I had followed the link you suggested but must've missed a step because I repeated the process and it seems to have made an improvement. One unintended consequence of the proscribed process is that yum -y update php* updated more than just PHP. I now find that I have zoneminder 1.30 instead of 1.29. No issue with that other than the database needing updated to get it running again.

So for completeness in the case of others with a similar issue. I followed the link provided to update php. I am currently running ZM 1.30 on CentOs 6.8
with ugrades from ZM 1.28 being done with the CentOs GUI software updater for 1.29 and yum command line update for 1.30. PHP is at 5.4.

I still have issues with ZMninja but I will search around a bit before posting a help request. Essentially I have a connection and can see the monitor info but no actual monitor or event images and the event tools show 0 events when there are events existing.

Re: API - troubleshooting help request

Posted: Wed Jun 29, 2016 3:51 pm
by asker
Sounds good. An interim step may be to ignore zmNinja for a moment, and try the APIs with your browser

server/zm/api/host/getVersion.json -- should return a version
server/zm/api/monitors.json -- should return a list of monitors

If they work, then make sure you are using the same login account with zmNinja