Vinnie Saletto
Vinnie Saletto

Reputation: 329

CGI script presenting me "garbage" as opposed to JSON object

So, for my testing environment here I have a Windows 8 machine running VMWare with a CentOS5 instance. I have two sites running. One of them can be reached at an IP address with port 1841, and the other with the default port. When trying to get JSON data from the default site FROM the 1841 site, I was obviously met with a cross browser issue. Even though the IP addresses are the same, I couldn't use the different ports.

OK, so the next thing I thought of would be to put a link from a folder in the default directory, and have it present the same information, and you know what? It worked! Sort of worked, actually.

If I run from the terminal in the CentOS box, everything looks great. Here is the example of what I want

Yet, when running from the browser, I get this... No such luck here

What am I doing wrong here? To the browser, I now have the script appearing to be from the same root and port.

Upvotes: 0

Views: 90

Answers (1)

Gillsoft AB
Gillsoft AB

Reputation: 4225

My guess is that you use Apache as a web server and got a MIME configuration problem since you get an executable (e.g. the elf header) which probably is the cgi script.

My recommendation is that you read Apache cgi docs and mod_mime_magic in order to configure MIME properly.

Good luck!

Upvotes: 1

Related Questions