Solved

500 server error

Posted on 1998-10-10
2
130 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
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 …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

895 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

18 Experts available now in Live!

Get 1:1 Help Now