Web app launch fails with JSON.parse error

I’ve built a very simple web app. When I deploy it as a CGI app on my local Apache server, it works fine. However, when I try to deploy the same build on my web hosting service, the app starts to launch, then fails with this error:

Trouble evaluating response: JSON.parse : unexpected character
Source: Unable to launch application ‘MapViewer’ on port 13231.

The webserver error log says: Premature end of script headers.

Does anyone know what I need to do to get this app working correctly on both hosts?

Make sure you CHMOD the binary and .cgi file 755.

I’d make sure the app itself will run. If you have command line access, just try to launch it, because if there are any errors, you’ll see them there.

Phillip: yes, that’s already the case.

Greg: I’ve tried running the app on the web host using SSH. if I run the cgi, I get the same error message as running from a web browser (but no mention of JSON errors). If I run the app, it just returns with no output, no errors.

I think the JSON issue may be a red herring. I just tried to run my app in a web browser, and got the Loading message, followed by the Disconnect message. Both of these are set by the app, so it seems that it loads and runs, but fails to send the default web page. No mention of JSON errors this time.

The JSON message you are getting is from the browser because the error message in the response is not in the right format for the json parser.

It still sounds like a permission error.