Solved

500 server error

Posted on 1998-10-10
2
135 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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.

752 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