API - troubleshooting help request

Forum for questions and support relating to the 1.29.x releases only.
Locked
kkrofft
Posts: 41
Joined: Sun Mar 16, 2014 9:55 pm

API - troubleshooting help request

Post 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
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API - troubleshooting help request

Post 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.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
kkrofft
Posts: 41
Joined: Sun Mar 16, 2014 9:55 pm

(Resolved) Re: API - troubleshooting help request

Post 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.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API - troubleshooting help request

Post 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
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Locked