I have a web-based program - running on Apache Server- that works fine and does some kind of online simulation . Now I am trying to transfer it on Windows 2000 server.

In this program, the user (client) "submit" some data through a html page in web which will run a cgi file on server. The cgi file put the submitted data in a txt file, and then calls an simulation.exe file which does some calculations on that data and make the output in another txt file and redirect to another html page which would contain the results of simulation. All the cgi processings and simulation executions are done on server and the client only sees the final results in the following page.

I came across with the problem of processing the cgi file in Windows. The cgi file is written in Perl. I saved both cgi file and that simulation.exe file in the same folder in wwwroot/inetpub/myfolder, but when I put adress http://localhost/myfolder/myfile.cgi in IE, it halts trying to run the cgi file, in spite of the fact that the related process (simulation.exe) is called ( as I checked in the "processor" tab.)

By the way, I have installed perl and set .cgi files to be opened by perl. The problem cant be with the syntax of the code since the cgi file can be run properly from the commandline using the perl command: perl myfile.cgi and the simulation is executed. But with IE, the problem arises. However, if I omit that simulation.exe commad line in cgi file, I can run the cgi file from IE without problem. So runnig the .exe file causes the problem. I did set the permissions (reading, writing,code executing) in Internet service manager.

My perl code:

#!c:/perl/bin/perl print "Content-type: text/html\n\n"; print"Hi!"; `simulation`;

Considered by trammell for readmore tags. Vote results (Keep/Edit/Delete): 9/11/3.
Unconsidered by davido: No vote consensus.
Janitored by davido: Added code tags and formatting to mirror OP's text entry format.


In reply to PLEASE HELP! How to make an exe file be executed on server through a cgi file? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.