500 Internal Server Error

Posted on 2006-05-18
Medium Priority
Last Modified: 2013-12-25
I dont know what im doing wrong with this c++ script.

I compile it with Dev C++ v4, then I upload the file as .cgi
change to 755 and try to run it and nothing!!

#include <iostream.h>
#include <time.h>

int main()
        time_t  now;
      cout << "Content-type: text/html\n\n";
    cout << "<html>";
    cout << "<head><title>Hello World</title></head>";
      cout << "<H1>Hello World</H1>";
    cout << "I'm a C++ Classless Program<br>";
      cout << ("It is now %s",ctime(&now));
    cout << "</body>";
    cout << "</html>";

the log shows me this message
[2006-05-19 01:46:25]: info: (real/target/actual) uid: (home/site/lses) gid: (home/site/lses) cmd: test.cgi alt_doc_root: /home/virtual/site1/fst/var/www chroot: 0
Question by:aplelois
  • 2

Accepted Solution

Perl_Diver earned 2000 total points
ID: 16715616
Most CGI scripts are perl scripts but CGI scripts can be written in many languages besides perl. I don't know C++, but does the server you are using allow you to run C++ programs as .cgi scripts? The typical web host is not setup to run C++ scripts.

Author Comment

ID: 16715634
well I downloaded a c script from a website and its running fine!

Expert Comment

ID: 16715651
OK, well, since I am not a C++ coder I can't offer anymore help.

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question