?
Solved

500 Internal Server Error

Posted on 2006-05-18
3
Medium Priority
?
168 Views
Last Modified: 2013-12-25
hello,
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;
        time(&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
0
Comment
Question by:aplelois
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
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.
0
 

Author Comment

by:aplelois
ID: 16715634
well I downloaded a c script from a website and its running fine!
0
 
LVL 8

Expert Comment

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

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