We help IT Professionals succeed at work.

problems with cgi programming in c++

bhksharma
bhksharma asked
on
dear samri
i have added the following in the httpd.conf file apache
    ScriptAlias /cgi-bin/ "e:/Program Files/cgi-bin/"
    #
    # "e:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
          <Directory "e:/Program Files/Apache Group/Apache/cgi-bin">
       AllowOverride None
       Options None
       Order allow,deny
       Allow from all
   </Directory>
 The following error gets displayed when i tried to run the program in the browser.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@magnasoft and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.22 Server at harikris.lk Port 80

The following is the error displayed in the server's log file
[Fri Mar 01 15:40:44 2002] [error] [client 127.0.0.1] malformed header from script. Bad header=<html><title> Sample CGI C++ S: e:/program files/cgi-bin/test.exe


could u please let me know how to proceed further?
Comment
Watch Question

Software Craftsman
Commented:
Before outputting your actual HTML response, you'll need to write some headers from your CGI.  At the very least, try sending "Content-type: text/html\n\n" first.  There are other headers you can send (for example, if you want to send the user a cookie, or specify the length of what you are sending) but that should get you started.

Basically, you send the headers first, one per line, then a blank line, then your content (whatever it is; could be HTML, text, binary data for a GIF or JPG, etc. etc.)

Hope this helps.


Commented:
Dear bhksharma

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "cwrea "

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Force accepted

** Mindphaser - Community Support Moderator **

Explore More ContentExplore courses, solutions, and other research materials related to this topic.