in reply to Re^2: Accessing a C++ compiler through a CGI script
in thread Accessing a C++ compiler through a CGI script

Also, here is a quick demo of the program actually working. I guess you could use this in the meantime until you get yours up and running. Best of luck.
  • Comment on Re^3: Accessing a C++ compiler through a CGI script

Replies are listed 'Best First'.
Re^4: Accessing a C++ compiler through a CGI script
by Spidy (Chaplain) on Oct 27, 2005 at 19:57 UTC
    Alright, I've gotten my own version running, and tried yours, and it sort of appears to work, but it also gives an error when you actually compile things. (problem retrieving data). Any ideas?

    UPDATE: Also, after looking inside my web directory, it appears that there is no output.txt. Also, code.cpp isn't being created, either.

      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?
        Well, it appeared to attempt to compile and such...it just never told me whether it actually worked or not; it always gave me that data issue.

        Also, on my version, I'm having issues with getting it to print to output.txt and code.cpp, something about permissions errors and closed filehandles. Any ideas?