Solved

500 server error

Posted on 1998-10-10
2
129 Views
Last Modified: 2013-12-25
When I execute a very simple cgi program(By submitting a form)written in c++ using personal web server, I get
500 server error. What could cause this?
0
Comment
Question by:cMan
2 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 100 total points
ID: 1829026
500 is a general catch all for server errors. The most likely causes are that you CGI crashed or it output something on stderr.

Obviously the cause of a crash is impossible to tell without the code etc. Often the easiest way to test CGIs is to run them within a script and set up all the important environment variables (eg REQUEST_METHOD, QUERY_STRING etc) prior to execution.

If you are using VC++ or Borlan C++ and similar you can set the variables up in the environment and run the CGI in debug.

Steve
0
 

Author Comment

by:cMan
ID: 1829027
For obvious reasons I like to start out with something simple,
and here it is.

#include"iostream.h"


void main()
{
      cout <<"Content-type:text/html\n\n";
      cout <<"<html>\n";
      cout <<"<head>\n";
      cout <<"<title>";
      cout <<"CGI Output";
      cout <<"</title>\n";
      cout <<"</head>\n";
      cout <<"<body>\n";
      cout <<"CGI Output\n";
      cout <<"</body>\n";
      cout <<"</html>\n";
}
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to count occurrences of each item in an array.

759 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

21 Experts available now in Live!

Get 1:1 Help Now