500 Internal Server Error

Posted on 2006-05-18
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
    LVL 8

    Accepted Solution

    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

    well I downloaded a c script from a website and its running fine!
    LVL 8

    Expert Comment

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

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at (http://www.experts-ex…
    I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    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…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now