Yeah, when you put it on your server I think (i'm not very good with apache) that your apache path has to be set right. The first server i tested on had the path and permissions all setup. If the path isn't set try changing the file paths to their full path name... /home/var/www/blah/code.cpp and /home/var/www/blah/output.txt in code.cgi. Also make sure apache has permissions to write to that directory.

The 'problem receiving data' error comes when the response back from the script isn't a 200 OK response... which means that the script is probably erroring out giving you a 500 ERROR response. If it is doing that, it's probably due to permission/path issues.

When i put it on this server (2nd server i've put it on) i also noticed when apache ran g++ it didn't have permission to make a .o file. i'm still looking for a work-around for that problem... since g++ always wants to make a .o file. If you do get that error, at least you know it compiled successfully :). On my site i just put in some regexs to clean out the path and and that specific error message when it came up. If you could find another program that just checked the syntax, that should work fine as well... and just sub that in the system command. Hope this helps somewhat. The html file should still be ok.

UPDATE
by the way? so did my site work for you or not? and what do you mean by 'sort of worked' except when compiling?

In reply to Re^5: Accessing a C++ compiler through a CGI script by ickyb0d
in thread Accessing a C++ compiler through a CGI script by Spidy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.